File
class File (View source)
A File handling class
Methods
static string
stripExtension(string $file)
Strips the last extension off of a file name
static string
getExtension(string $file)
getExtension
static string
getFilename(string $path)
Get file name from a path.
static string
makeSafe(string $file, array $stripChars = array('#^\\.#'))
Makes the file name safe to use
static boolean
copy(string $src, string $dest, bool $force = false)
Copies a file
static boolean
delete(mixed $file)
Delete a file or array of files
static boolean
move(string $src, string $dest, bool $force = false)
Moves a file
static boolean
write(string $file, string $buffer)
Write contents to a file
static boolean
upload(string $src, string $dest)
Moves an uploaded file to a destination folder
Details
at line line 29
static string
stripExtension(string $file)
Strips the last extension off of a file name
at line line 43
static string
getExtension(string $file)
getExtension
at line line 57
static string
getFilename(string $path)
Get file name from a path.
at line line 81
static string
makeSafe(string $file, array $stripChars = array('#^\\.#'))
Makes the file name safe to use
at line line 106
static boolean
copy(string $src, string $dest, bool $force = false)
Copies a file
at line line 153
static boolean
delete(mixed $file)
Delete a file or array of files
at line line 188
static boolean
move(string $src, string $dest, bool $force = false)
Moves a file
at line line 236
static boolean
write(string $file, string $buffer)
Write contents to a file
at line line 263
static boolean
upload(string $src, string $dest)
Moves an uploaded file to a destination folder