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.
string
copyFile
(string $source, string $destination_dir, string $destination_file, [boolean $unique = true])
-
string
$source: where the file is from, full path to the files required
-
string
$destination_file: name of the new file, just the filename
-
string
$destination_dir: where the files, just the destination dir, e.g., /www/html/gallery/
-
boolean
$unique: create unique destination file if true.
Create a new folder.
boolean
createFolder
(string $newFolder)
-
string
$newFolder: specifiy the full path of the new folder.
Delete a file.
boolean
delFile
(string $file)
-
string
$file: file to be deleted
Delete folder(s), can delete recursively.
boolean
delFolder
(string $folder, [boolean $recursive = false])
-
string
$folder: the folder to be deleted.
-
boolean
$recursive: 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.
Escape the filenames, any non-word characters will be replaced by an underscore.
string
escape
(string $filename)
-
string
$filename: the orginal filename
Append a / to the path if required.
string
fixPath
(string $path)
Format the file size, limits to Mb.
string
formatSize
(int $size)
-
int
$size: the raw filesize
Similar to makePath, but the second parameter is not only a path, it may contain say a file ending.
string
makeFile
(string $pathA, string $pathB)
-
string
$pathA: the leading path
-
string
$pathB: the ending path with file
Concat two paths together. Basically $pathA+$pathB
string
makePath
(string $pathA, string $pathB)
-
string
$pathA: path one
-
string
$pathB: path two