Class FSTools
Inheritance | FSTools |
---|
Filesystem tools not provided by default; can recursively create, copy and delete folders. Some template methods are provided for extensibility.
Public Methods
Method | Description | Defined By |
---|---|---|
__call() | Allows for PHP functions to be called and be stubbed. | FSTools |
copyable() | Overloadable function that tests a filename for copyability. By default, everything should be copied; you can restrict things to ignore hidden files, unreadable files, etc. This function applies to copyr(). | FSTools |
copyr() | Copy a file, or recursively copy a folder and its contents; modified so that copied files, if PHP, have includes removed | FSTools |
globr() | Recursively globs a directory. | FSTools |
mkdirr() | Recursively creates a directory | FSTools |
rmdirr() | Delete a file, or a folder and its contents | FSTools |
setSingleton() | Sets our global singleton to something else; useful for overloading functions. | FSTools |
singleton() | Returns a global instance of FSTools | FSTools |
Method Details
Allows for PHP functions to be called and be stubbed.
public void __call ( $name, $args ) | ||
$name | ||
$args |
Overloadable function that tests a filename for copyability. By default, everything should be copied; you can restrict things to ignore hidden files, unreadable files, etc. This function applies to copyr().
public void copyable ( $file ) | ||
$file |
Copy a file, or recursively copy a folder and its contents; modified so that copied files, if PHP, have includes removed
public void copyr ( $source, $dest ) | ||
$source | ||
$dest |
Recursively globs a directory.
public void globr ( $dir, $pattern, $flags = NULL ) | ||
$dir | ||
$pattern | ||
$flags |
Recursively creates a directory
public void mkdirr ( $folder ) | ||
$folder | string | Name of folder to create |
Delete a file, or a folder and its contents
public void rmdirr ( $dirname ) | ||
$dirname |
Sets our global singleton to something else; useful for overloading functions.
public static void setSingleton ( $singleton ) | ||
$singleton |
Returns a global instance of FSTools
public static void singleton ( ) |