Filesystem
class Filesystem
A collection of static methods for manipulating the filesystem.
Traits
Config options
file_create_mask | integer | ||
folder_create_mask | integer |
Methods
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .
Gets the uninherited value for the given config option
Create a folder on the filesystem, recursively.
Remove a directory and all subdirectories and files.
Remove a directory, but only if it is empty.
Cleanup function to reset all the Filename fields. Visit File/fixfiles to call.
Return the most recent modification time of anything in the folder.
Returns true if the given filename is an absolute file reference.
Details
in Configurable at line 20
static Config_ForClass
config()
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .
....).
in Configurable at line 32
mixed
stat(string $name)
deprecated
deprecated 5.0 Use ->config()->get() instead
Get inherited config value
in Configurable at line 44
mixed
uninherited(string $name)
Gets the uninherited value for the given config option
in Configurable at line 57
$this
set_stat(string $name, mixed $value)
deprecated
deprecated 5.0 Use ->config()->set() instead
Update the config value for a given property
at line 43
static
makeFolder(String $folder)
Create a folder on the filesystem, recursively.
Uses {@link Filesystem::$folder_create_mask} to set filesystem permissions. Use {@link Folder::findOrMake()} to create a {@link Folder} database record automatically.
at line 60
static
removeFolder(String $folder, Boolean $contentsOnly = false)
Remove a directory and all subdirectories and files.
at line 89
static boolean
remove_folder_if_empty(string $folder, boolean $recursive = true)
Remove a directory, but only if it is empty.
at line 115
fixfiles()
deprecated
deprecated 5.0
Cleanup function to reset all the Filename fields. Visit File/fixfiles to call.
at line 138
static string
folderModTime(string $folder, array $extensionList = null)
Return the most recent modification time of anything in the folder.
at line 176
static Boolean
isAbsolute(String $filename)
Returns true if the given filename is an absolute file reference.
Works on Linux and Windows.