Storage
Quantum provides a simple `Storage`
library to interact with file system of server.
To start using the library you need to make it available in your controller and create new `FileSystem`
instance.
use Quantum\Libraries\Storage\FileSystem;
...
$fileSystem = new FileSystem();
...
The available methods of `FileSystem`
are listed bellow:
isFile($file)
- Indicates whether the$file
is a regular fileisDirectory($directory)
- Indicates whether the$directory
filename is a directoryisReadable($file)
- Indicates whether a file exists and is readableisWritable($file)
- Indicates whether the file is writableexists($file)
- Checks whether a file or directory existsget($file)
- Reads entire file into a stringsize($file)
- Gets the file sizebaseName($file)
- Gets the file base name (<filename>.<extension>)fileName($file)
- Gets the file name onlyextension($file)
- Gets the file extensionput($file, $data, $lock = false)
- Writes data into the fileappend($file, $data, $lock = false)
- Appends the data to the file instead of overwriting itrename($oldName, $newName)
- Renames the file or directorycopy($source, $dest)
- Copies the filemakeDirectory($path, $mode = 0777, $recursive = false)
- Makes directoryglob($pattern, $flags = 0)
- Find pathnames matching a patternremove($file)
- Deletes the file