Class FSTools

InheritanceFSTools

Filesystem tools not provided by default; can recursively create, copy and delete folders. Some template methods are provided for extensibility.

Public Methods

Hide inherited methods

MethodDescriptionDefined 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

__call() public method

Allows for PHP functions to be called and be stubbed.

public void __call ( $name, $args )
$name
$args
copyable() public method

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
copyr() public method

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
globr() public method

Recursively globs a directory.

public void globr ( $dir, $pattern, $flags NULL )
$dir
$pattern
$flags
mkdirr() public method

Recursively creates a directory

public void mkdirr ( $folder )
$folder string

Name of folder to create

rmdirr() public method

Delete a file, or a folder and its contents

public void rmdirr ( $dirname )
$dirname
setSingleton() public static method

Sets our global singleton to something else; useful for overloading functions.

public static void setSingleton ( $singleton )
$singleton
singleton() public static method

Returns a global instance of FSTools

public static void singleton ( )