File System Class

The following sections explain each method of the class.

is_really_writable


public static boolean is_really_writable ( string $file)

Controls whether the file or folder is really describable. This is an advanced feature to is_writable function of PHP itself, there are different UNIX and WIN systems here.

Parameter list
file

The path to the file or folder to be monitored.


get_all_files


public static array|boolean get_all_files ( string $path, int $orderBack = \RecursiveIteratorIterator::SELF_FIRST, boolean $withData = false)

Reads all the files in a directory and returns it sorted with basic information about the files back.

Parameter list
path

The absolute path to the directory where the files are listed.

orderBack

The indication that the list is to be read by. Default: \RecursiveIteratorIterator::SELF_FIRST set. Allowed are the following:

  • \RecursiveIteratorIterator::LEAVES_ONLY
  • \RecursiveIteratorIterator::SELF_FIRST
  • \RecursiveIteratorIterator::CHILD_FIRST
  • \RecursiveIteratorIterator::CATCH_GET_CHILD

withData

Whether the files are returned with detailed information about themselves true or only with basic information false


delete_files


public static boolean delete_files ( string $path, boolean $delete_dir = false)

Deletes recursively all files and folders in a specified directory. Then you have the possibility also to delete the specified directory itself yet.

Parameter list
path

The absolute path to the directory from the locate the file and folder to be removed recursively.

delete_dir

Can be specified if the directory specified absolutely to be removed after the successful recursive deletion itself true or whether it should remain false


copyDirectory


public static boolean copyDirectory ( string $source, string $dest, int $chmod = 0755)

Copies the contents of absolutely specified directory recursively in an absolutely specified target directory.

Parameter list
source

The absolutely specified directory from which the content is to be recursively copied to a target directory.

dest

The destination directory specified absolutely.

chmod

The access rights of the copied files and folders. By default set to 0755.


renameDirectory


public static boolean renameDirectory ( string $source, string $dest, int $chmod = 0755)

Moves the contents of a directory in absolute emitted an absolutely specified target directory.

Parameter list
source

The absolutely specified directory from which the content is to be recursively copied into an absolutely specified target directory.

dest

The destination directory specified absolutely.

chmod

The access rights of the moved files and folders in the new destination directory. By default on 0755.