Class virtual_fs

Description

Located in /sources/occle.php (line 1323)


	
			
Method Summary
virtual_fs virtual_fs ()
boolean append_file (array $to_append, string $contents)
boolean change_directory (array $target_directory)
boolean copy_directory (array $to_copy, array $destination)
boolean copy_file (array $to_copy, array $destination)
array listing ([?array $dir = NULL])
boolean make_directory (array $directory)
boolean move_directory (array $to_move, array $destination)
boolean move_file (array $to_move, array $destination)
mixed print_working_directory ([boolean $array_form = false])
~string read_file (array $to_read)
boolean remove_directory (array $directory)
boolean remove_file (array $to_remove)
array search (string $pattern, [boolean $regexp = false], [boolean $recursive = false], [boolean $files = true], [boolean $directories = false], [?array $dir = NULL])
boolean write_file (array $to_write, string $contents)
~array _discern_meta_dir (array &$meta_dir, string &$meta_root_node, string &$meta_root_node_type, [?array $dir = NULL])
~array _get_current_dir_contents ([?array $dir = NULL], [boolean $full_paths = false])
string _get_filename (string $filename)
boolean _is_dir ([?array $dir = NULL])
boolean _is_file (array $dir)
array _merge_pwds (array $pwd1, array $pwd2)
array _pwd_to_array (string $pwd)
string _pwd_to_string ([?array $pwd = NULL])
array _start_pwd ()
Methods
Constructor virtual_fs (line 1328)

Constructor function. Setup a virtual filesystem, but do nothing with it.

virtual_fs virtual_fs ()
append_file (line 1942)

Append to a file.

  • return: Success?
boolean append_file (array $to_append, string $contents)
  • array $to_append: The file to which to append
  • string $contents: The contents to append
change_directory (line 1713)

Change the current working directory. Equivalent to Unix "cd".

  • return: Success?
boolean change_directory (array $target_directory)
  • array $target_directory: The target directory path
copy_directory (line 1789)

Copy a directory. Equivalent to Unix "cp".

  • return: Success?
boolean copy_directory (array $to_copy, array $destination)
  • array $to_copy: The directory to copy
  • array $destination: The destination path
copy_file (line 1842)

Copy a file. Equivalent to Unix "cp".

  • return: Success?
boolean copy_file (array $to_copy, array $destination)
  • array $to_copy: The file to copy
  • array $destination: The destination path
listing (line 1617)

Return a directory and file listing of the current working directory. Equivalent to Unix "ls".

  • return: Directories and files in the current working directory
array listing ([?array $dir = NULL])
  • ?array $dir: An alternate directory in which to perform the action (NULL: current directory is used)
make_directory (line 1732)

Create a directory under the current working directory. Equivalent to Unix "mkdir".

  • return: Success?
boolean make_directory (array $directory)
  • array $directory: The new directory's path and name
move_directory (line 1828)

Move a directory. Equivalent to Unix "mv".

  • return: Success?
boolean move_directory (array $to_move, array $destination)
  • array $to_move: The directory to move
  • array $destination: The destination path
move_file (line 1856)

Move a file. Equivalent to Unix "mv".

  • return: Success?
boolean move_file (array $to_move, array $destination)
  • array $to_move: The file to move
  • array $destination: The destination path
print_working_directory (line 1601)

Return the current working directory of the virtual filesystem. Equivalent to Unix "pwd".

  • return: The current working directory (array or string)
mixed print_working_directory ([boolean $array_form = false])
  • boolean $array_form: Return the pwd in array form?
read_file (line 1892)

Read a file and return the contents.

  • return: The file contents (false: failure)
~string read_file (array $to_read)
  • array $to_read: The file to read
remove_directory (line 1756)

Remove a directory under the current working directory. Equivalent to Unix "rmdir".

  • return: Success?
boolean remove_directory (array $directory)
  • array $directory: The directory-to-remove's path and name
remove_file (line 1868)

Remove a file. Equivalent to Unix "rm".

  • return: Success?
boolean remove_file (array $to_remove)
  • array $to_remove: The file to remove
search (line 1658)

Return a listing of all the files/directories found matching the specified pattern. Equivalent to Unix "find".

  • return: The search results
array search (string $pattern, [boolean $regexp = false], [boolean $recursive = false], [boolean $files = true], [boolean $directories = false], [?array $dir = NULL])
  • string $pattern: The search pattern (PRCE regexp or plain)
  • boolean $regexp: Is the search pattern a regexp?
  • boolean $recursive: Should the search be recursive?
  • boolean $files: Should files be included in the results?
  • boolean $directories: Should directories be included in the results?
  • ?array $dir: Directory (NULL: current directory is used)
write_file (line 1917)

Write to a file; create the file if it doesn't exist.

  • return: Success?
boolean write_file (array $to_write, string $contents)
  • array $to_write: The file to write
  • string $contents: The contents to write
_discern_meta_dir (line 1566)

Get details of the current meta directory.

  • return: Current directory (false: error)
~array _discern_meta_dir (array &$meta_dir, string &$meta_root_node, string &$meta_root_node_type, [?array $dir = NULL])
  • array &$meta_dir: Meta directory
  • string &$meta_root_node: Meta root node
  • string &$meta_root_node_type: Meta root node type
  • ?array $dir: Directory (NULL: current directory is used)
_get_current_dir_contents (line 1394)

Return the contents of the given directory in $this->virtual_fs (i.e. ls without the fancy bits).

  • return: Directory contents (false: failure)
~array _get_current_dir_contents ([?array $dir = NULL], [boolean $full_paths = false])
  • ?array $dir: Directory (NULL: current directory is used)
  • boolean $full_paths: Whether to use full paths
_get_filename (line 1505)

Return filename from a path.

  • return: Filename
string _get_filename (string $filename)
  • string $filename: Path
_is_dir (line 1518)

Is it a directory?

  • return: Directory?
boolean _is_dir ([?array $dir = NULL])
  • ?array $dir: Path to check (NULL: current dir is used)
_is_file (line 1540)

Is it a file?

  • return: Directory?
boolean _is_file (array $dir)
  • array $dir: Path (with filename) to use
_merge_pwds (line 1473)

Merge an absolute array-form path with a non-absolute array-form path.

  • return: Merged path
array _merge_pwds (array $pwd1, array $pwd2)
  • array $pwd1: Absolute path
  • array $pwd2: Non-absolute path
_pwd_to_array (line 1456)

Convert a string-form path to an array.

  • return: Array-form path
array _pwd_to_array (string $pwd)
  • string $pwd: Path
_pwd_to_string (line 1491)

Convert an array-form path to a string.

  • return: String-form path
string _pwd_to_string ([?array $pwd = NULL])
  • ?array $pwd: Path (NULL: use $this->pwd)
_start_pwd (line 1371)

Fetch the current directory from a cookie, or the default.

  • return: Current directory
array _start_pwd ()

Documentation generated on Sun, 02 Jan 2011 23:19:20 +0000 by phpDocumentor 1.4.3