Files::makeFile PHP Method

makeFile() public method

Similar to makePath, but the second parameter is not only a path, it may contain say a file ending.
public makeFile ( string $pathA, string $pathB ) : string
$pathA string the leading path
$pathB string the ending path with file
return string combined file path.
    function makeFile($pathA, $pathB)
    {
        $pathA = Files::fixPath($pathA);
        if (substr($pathB, 0, 1) == '/') {
            $pathB = substr($pathB, 1);
        }
        return $pathA . $pathB;
    }

Usage Example

 /**
  * Delete the relative file, and any thumbnails.
  * @param string $relative the relative file.
  * @return boolean true if deleted, false otherwise.
  */
 function _delFile($relative)
 {
     $fullpath = Files::makeFile($this->getImagesDir(), $relative);
     //check that the file is an image
     if ($this->config['validate_images'] == true) {
         if (!is_array($this->getImageInfo($fullpath))) {
             return false;
         }
         //hmmm not an Image!!???
     }
     $thumbnail = $this->getThumbName($fullpath);
     if (Files::delFile($fullpath)) {
         return Files::delFile($thumbnail);
     } else {
         return false;
     }
 }
All Usage Examples Of Files::makeFile