|
Squiz Matrix
4.12.2
|
Static Public Member Functions | |
| static | clearDirectory ($path, $deleteRoot=FALSE, array $omitFiles=array()) |
| static | listDirectory ($path, array $extensions=array(), $nested=TRUE, $fullPath=TRUE) |
| static | findDirectories ($path, $name) |
| static | getHashDir ($id) |
| static | readableSize ($path, $unit=NULL) |
| static | getBaseName ($path) |
Data Fields | |
| const | HASH_DIR_FILE_COUNT = 10000 |
| const | FILE_SIZE_BYTE = 'B' |
| const | FILE_SIZE_KILOBYTE = 'kB' |
| const | FILE_SIZE_MEGABYTE = 'MB' |
| const | FILE_SIZE_GIGABYTE = 'GB' |
Library for general file system operations.
Methods for adding, deleting and modifying directories and files should reside here.
Definition at line 21 of file FileSystem.inc.
|
static |
Removes a directory from the file system.
Enters subdirectories and removes all content, and deletes the parent directory if specified.
| string | $path | The path of the directory to delete. |
| boolean | $deleteRoot | Whether to delete the parent directory. |
| array | $omitFiles | Array of file names that lie in the root directory that should not be deleted. Note, the $deleteRoot param should be false if this is not empty. |
| RuntimeException | When the environment prevents the directory from being succesfully deleted. |
Definition at line 60 of file FileSystem.inc.
|
static |
Recursively finds directories with the specified name.
Returns the absolute paths to the directories, starting from the specified path.
| string | $path | The path of the directory to start at. |
| string | $name | The name of the directories to find. |
Definition at line 230 of file FileSystem.inc.
|
static |
Basename for unix and Windows.
| string | $path | Path for a file. |
Definition at line 323 of file FileSystem.inc.
|
static |
Returns the relative hash directory for the specified id.
| integer | $id | The positive integer to return the hash dir for. |
| InvalidArgumentException | When a negative $id is passed. |
Definition at line 259 of file FileSystem.inc.
|
static |
Lists the contents of a directory.
Allows the specifying of file extensions, and whether or not to include full paths in the resulting array, or just filenames. Returns an array of file names.
| string | $path | The path of the directory to list. |
| array | $extensions | An array of extensions (with the leading dots) of files to return. |
| boolean | $nested | Include subdirectories in the listing. |
| boolean | $fullPath | Include the full path, or just the filename. |
Definition at line 144 of file FileSystem.inc.
|
static |
Return the size of a file with human readable units appended.
| string | $path | The path to the file. |
| string | $unit | Units to display file size with (see constants). |
Definition at line 283 of file FileSystem.inc.