File
class File
A File handling class
Methods
static
string
getExt(
string $file)
Gets the extension of a file name
static
string
stripExt(
string $file)
Strips the last extension off of a file name
static
string
makeSafe(
string $file)
Makes file name safe to use
static
boolean
copy(
string $src,
string $dest,
string $path = null,
boolean $use_streams = false)
Copies a file
static
boolean
delete(
mixed $file)
Delete a file or array of files
static
boolean
move(
string $src,
string $dest,
string $path = '',
boolean $use_streams = false)
Moves a file
static
mixed
read(
string $filename,
boolean $incpath = false,
integer $amount,
integer $chunksize = 8192,
integer $offset)
Read the contents of a file
static
boolean
write(
string $file,
string $buffer,
boolean $use_streams = false)
Write contents to a file
static
boolean
append(
string $file,
string $buffer,
boolean $use_streams = false)
Append contents to a file
static
boolean
upload(
string $src,
string $dest,
boolean $use_streams = false,
boolean $allow_unsafe = false,
boolean $safeFileOptions = array())
Moves an uploaded file to a destination folder
static
boolean
exists(
string $file)
Wrapper for the standard file_exists function
static
string
getName(
string $file)
Returns the name, without any path.
Details
static
boolean
copy(
string $src,
string $dest,
string $path = null,
boolean $use_streams = false)
Copies a file
static
boolean
move(
string $src,
string $dest,
string $path = '',
boolean $use_streams = false)
Moves a file
static
mixed
read(
string $filename,
boolean $incpath = false,
integer $amount,
integer $chunksize = 8192,
integer $offset)
Read the contents of a file
static
boolean
write(
string $file,
string $buffer,
boolean $use_streams = false)
Write contents to a file
static
boolean
append(
string $file,
string $buffer,
boolean $use_streams = false)
Append contents to a file