An abstract class for writing to the filesystem. We use this to access the concrete subclasses for native filesystem and FTP access. Maybe one day there will be some other useful method for filesystem access....
Get the working directory for the class.
Returns; A string with the working directory reported by the filesystem functions.
Wrapper around native getcwd() function. This is always the local current directory, regardless of the filesystem driver.
public abstract function chdir( |
| ) |
Change working directory
dir | A standard local path to the new directory. |
True on success, false on failure.
public abstract function mkdir( |
| ) |
Create a new directory. For this function, the immediate parent directory must exist
dir | The local path to the new directory. |
mode | An optional umask for file permissions on the new directory. |
False on failure, an unspecified non-false value on success.
public abstract function mkdir_rec( |
| ) |
Recursive version of mkdir. This will create all non-existent parents of the target path.
dir | The local path to the new directory. |
mode | An optional umask for file permissions on the new directory. |
False on failure, a non-false value on success.
public abstract function rmdir( |
| ) |
Remove an empty directory.
dir | The local path of the directory to remove. |
True on success, false on failure.
public abstract function rmdir_rec( |
| ) |
Recursive version of rmdir. Remove a directory and all files and directories it contains.
dir | The local path of the directory to remove. |
True on success, false on failure.
public abstract function chmod( |
| ) |
Change permissions on a file or directory.
path | The local path to the file to change. |
mode | The UNIX octal value to set the permissions to. |
False on failure, an unspecified non-false value on success.
public function directoryMode( |
| ) |
Gets and sets the permissions to use when creating directories.
mode | The optional octal permissions to use. |
The octal UNIX permissions used when creating directories.
public function scriptMode( |
| ) |
Gets and sets the
mode | The optional octal permissions to use. |
The octal UNIX permissions used when creating PHP scripts.
public function defaultMode( |
| ) |
Gets and sets the permissions to use for other files, i.e. not directories or PHP scripts
mode | The optional octal permissions to use. |
The octal UNIX permissions used when creating other files.
public function isScript( |
| ) |
Determines if a given path represents a PHP script or not.
path | the path of the file in question. |
True if the file uses a known extension for PHP scripts, false otherwise. Currently, known extensions are of the form .phpX where X is empty or a number.
public abstract function copy( |
| ) |
Copy a single file.
src | The local path to the file to copy |
dest | The path to copy it to. |
True on success, false on failure.
public abstract function rename( |
| ) |
Move or rename a file.
src | The local path to the file to move or rename. |
dest | The new file path. |
True on success, false on failure.
public abstract function delete( |
| ) |
Delete a single file.
src | The local path to the file to delete. |
True on success, false on failure.
public abstract function write_file( |
| ) |
Write a string to a new text file.
path | The local path to the file. |
contents | A string containing te desired contents of the file. |
False on failure, an unspecified non-false value on success.
public function copy_rec( |
| ) |
Recursively copy a directory. If called on a file, it will just copy the file.
src | The source directory to copy |
dest | The destination directory |
True on success, false if any part of the operation (file copy or directory creation) fails.
public function read_file( |
| ) |
Read a file from disk.
path | The path to the file to read. |
The file contents as a string, or calse on failure.
public function readfile( |
| ) |
Wrapper around native readfile() function.
Wrapper around the native echo statement.
public function is_dir( |
| ) |
Wrapper around native is_dir() function.
public function is_file( |
| ) |
Wrapper around native is_file() method
public function is_uploaded_file( |
| ) |
Wrapper around native is_uploaded_file() function.
public function file_exists( |
| ) |
Wrapper around native file_exists() function.
public function scandir( |
| ) |
Wraper around native scandir() function.
public function scan_directory( |
| ) |
Does essentially the same thing as scandir on PHP 5. Gets all the entries in the given directory.
path | The directory path to scan. |
dirs_only | Optional parameter to list only the directories in the path. The default is false. |
An array of directory entry names, removing "." and ".." entries.
public function glob( |
| ) |
Does a shell wildcard glob and returns the results.
expression = (string) The wildcard pattern to match. flags - (int) A bitmask of flags to manipulate the glob behavior.
An array containing the list of matched files and/or directories.
public function filesize( |
| ) |
Wrapper around native filesize() function.
public function filemtime( |
| ) |
Wrapper around native filemtime function.
public function file( |
| ) |
Wrapper around native file function.
public function realpath( |
| ) |
Wrapper around native realpath function.
public function is_link( |
| ) |
Wrapper around native is_link function.
public function symlink( |
| ) |
Wrapper around native symlink function.