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 file
  • isDirectory($directory) - Indicates whether the $directory filename is a directory
  • isReadable($file) - Indicates whether a file exists and is readable
  • isWritable($file) - Indicates whether the file is writable
  • exists($file) - Checks whether a file or directory exists
  • get($file) - Reads entire file into a string
  • size($file) - Gets the file size
  • baseName($file) - Gets the file base name (<filename>.<extension>)
  • fileName($file) - Gets the file name only
  • extension($file) - Gets the file extension
  • put($file, $data, $lock = false) - Writes data into the file
  • append($file, $data, $lock = false) - Appends the data to the file instead of overwriting it
  • rename($oldName, $newName) - Renames the file or directory
  • copy($source, $dest) - Copies the file
  • makeDirectory($path, $mode = 0777, $recursive = false) - Makes directory
  • glob($pattern, $flags = 0) - Find pathnames matching a pattern
  • remove($file) - Deletes the file
<< Prev Next >>