Method | Description | |
---|---|---|
copyFile ( string $source, string $destination_dir, string $destination_file, boolean $unique = true ) : string | Copy a file from source to destination. If unique == true, then if the destination exists, it will be renamed by appending an increamenting counting number. | |
createFolder ( string $newFolder ) : boolean | Create a new folder. | |
delFile ( string $file ) : boolean | Delete a file. | |
delFolder ( string $folder, boolean $recursive = false ) : boolean | Delete folder(s), can delete recursively. | |
escape ( string $filename ) : string | Escape the filenames, any non-word characters will be replaced by an underscore. | |
fixPath ( string $path ) : string | Append a / to the path if required. | |
formatSize ( integer $size ) : string | Format the file size, limits to Mb. | |
makeFile ( string $pathA, string $pathB ) : string | Similar to makePath, but the second parameter is not only a path, it may contain say a file ending. | |
makePath ( string $pathA, string $pathB ) : string | Concat two paths together. Basically $pathA+$pathB |
public copyFile ( string $source, string $destination_dir, string $destination_file, boolean $unique = true ) : string | ||
$source | string | where the file is from, full path to the files required |
$destination_dir | string | where the files, just the destination dir, e.g., /www/html/gallery/ |
$destination_file | string | name of the new file, just the filename |
$unique | boolean | create unique destination file if true. |
return | string | the new copied filename, else error if anything goes bad. |
public createFolder ( string $newFolder ) : boolean | ||
$newFolder | string | specifiy the full path of the new folder. |
return | boolean | true if the new folder is created, false otherwise. |
public delFolder ( string $folder, boolean $recursive = false ) : boolean | ||
$folder | string | the folder to be deleted. |
$recursive | boolean | if true, all files and sub-directories are delete. If false, tries to delete the folder, can throw error if the directory is not empty. |
return | boolean | true if deleted. |
public formatSize ( integer $size ) : string | ||
$size | integer | the raw filesize |
return | string | formated file size. |