Filesystem
class Filesystem (View source)
Traits
Methods
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Determine if a file or directory exists.
Get the contents of a file.
Get contents of a file with shared access.
Get the returned value of a file.
Require the given file once.
Write the contents of a file.
Prepend to a file.
Append to a file.
Delete the file at a given path.
Move a file to a new location.
Copy a file to a new location.
Extract the file name from a file path.
Extract the trailing name component from a file path.
Extract the parent directory from a file path.
Extract the file extension from a file path.
Get the file type of a given file.
Get the mime-type of a given file.
Get the file size of a given file.
Get the file's last modification time.
Determine if the given path is a directory.
Determine if the given path is writable.
Determine if the given path is a file.
Find path names matching a given pattern.
Get an array of all files in a directory.
Get all of the files from the given directory (recursive).
Get all of the directories within a given directory.
Create a directory.
Copy a directory from one location to another.
Recursively delete a directory.
Empty the specified directory of all files and folders.
Details
static
mixed
__callStatic(
string $method,
array $parameters)
Dynamically handle calls to the class.
at line line 107
int
put(
string $path,
string $contents,
bool $lock = false)
Write the contents of a file.
at line line 206
string
basename(
string $path)
Extract the trailing name component from a file path.
at line line 350
array
allFiles(
string $directory)
Get all of the files from the given directory (recursive).
at line line 361
array
directories(
string $directory)
Get all of the directories within a given directory.
at line line 381
bool
makeDirectory(
string $path,
int $mode = 493,
bool $recursive = false,
bool $force = false)
Create a directory.
at line line 398
bool
copyDirectory(
string $directory,
string $destination,
int $options = null)
Copy a directory from one location to another.
at line line 451
bool
deleteDirectory(
string $directory,
bool $preserve = false)
Recursively delete a directory.
The directory itself may be optionally preserved.
at line line 488
bool
cleanDirectory(
string $directory)
Empty the specified directory of all files and folders.