Filesystem
class Filesystem (View source)
Methods
bool | exists(string $path) Determine if a file exists. | |
string | get(string $path) Get the contents of a file. | |
mixed | getRequire(string $path) Get the returned value of a file. | |
mixed | requireOnce(string $file) Require the given file once. | |
int | put(string $path, string $contents, bool $lock = false) Write the contents of a file. | |
int | prepend(string $path, string $data) Prepend to a file. | |
int | append(string $path, string $data) Append to a file. | |
bool | delete(string|array $paths) Delete the file at a given path. | |
bool | move(string $path, string $target) Move a file to a new location. | |
bool | copy(string $path, string $target) Copy a file to a new location. | |
string | name(string $path) Extract the file name from a file path. | |
string | extension(string $path) Extract the file extension from a file path. | |
string | type(string $path) Get the file type of a given file. | |
int | size(string $path) Get the file size of a given file. | |
int | lastModified(string $path) Get the file's last modification time. | |
bool | isDirectory(string $directory) Determine if the given path is a directory. | |
bool | isWritable(string $path) Determine if the given path is writable. | |
bool | isFile(string $file) Determine if the given path is a file. | |
array | glob(string $pattern, int $flags) Find path names matching a given pattern. | |
array | files(string $directory) Get an array of all files in a directory. | |
array | allFiles(string $directory) Get all of the files from the given directory (recursive). | |
array | directories(string $directory) Get all of the directories within a given directory. | |
bool | makeDirectory(string $path, int $mode = 0755, bool $recursive = false, bool $force = false) Create a directory. | |
bool | copyDirectory(string $directory, string $destination, int $options = null) Copy a directory from one location to another. | |
bool | deleteDirectory(string $directory, bool $preserve = false) Recursively delete a directory. | |
bool | cleanDirectory(string $directory) Empty the specified directory of all files and folders. |
Details
bool exists(string $path)
Determine if a file exists.
string get(string $path)
Get the contents of a file.
mixed getRequire(string $path)
Get the returned value of a file.
mixed requireOnce(string $file)
Require the given file once.
int put(string $path, string $contents, bool $lock = false)
Write the contents of a file.
int prepend(string $path, string $data)
Prepend to a file.
int append(string $path, string $data)
Append to a file.
bool delete(string|array $paths)
Delete the file at a given path.
bool move(string $path, string $target)
Move a file to a new location.
bool copy(string $path, string $target)
Copy a file to a new location.
string name(string $path)
Extract the file name from a file path.
string extension(string $path)
Extract the file extension from a file path.
string type(string $path)
Get the file type of a given file.
int size(string $path)
Get the file size of a given file.
int lastModified(string $path)
Get the file's last modification time.
bool isDirectory(string $directory)
Determine if the given path is a directory.
bool isWritable(string $path)
Determine if the given path is writable.
bool isFile(string $file)
Determine if the given path is a file.
array glob(string $pattern, int $flags)
Find path names matching a given pattern.
array files(string $directory)
Get an array of all files in a directory.
array allFiles(string $directory)
Get all of the files from the given directory (recursive).
array directories(string $directory)
Get all of the directories within a given directory.
bool makeDirectory(string $path, int $mode = 0755, bool $recursive = false, bool $force = false)
Create a directory.
bool copyDirectory(string $directory, string $destination, int $options = null)
Copy a directory from one location to another.
bool deleteDirectory(string $directory, bool $preserve = false)
Recursively delete a directory.
The directory itself may be optionally preserved.
bool cleanDirectory(string $directory)
Empty the specified directory of all files and folders.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/4.2/Illuminate/Filesystem/Filesystem.html