yana

phpDocumentor v 1.4.0

Class VDrive

Description

virtual Drive
Class to abstract from real filesystems by mapping filenames to aliases (mountpoints). Mountpoints may be mounted and unmounted at runtime. When reading a mountpoint, a corresponding file wrapper will be returned to work on the file.
Using virtual drives will clean your source from hard-coded file- and directory names, as well as doing all the job of creating and initializing the file wrappers for you.
  • access: public
  • name: VDrive
Object
   |
   --FileSystemResource
      |
      --FileReadonly
         |
         --VDrive
Method Summary
  • VDrive VDrive (string $path, [array $options = array()], [string $baseDir = ""], int $mode)
  • bool addDrive (string $filename, string $baseDir)
  • bool(false)|Mountpoint get (string $key)
  • bool mount (string $key)
  • bool read ()
  • string toString ()

Direct descendents

Class Description
Registry Registry

Methods

constructor
VDrive VDrive (
string $path, [array $options = array()], [string $baseDir = ""], int $mode
)
List of parameters:
Name Type Description
$path string
$options array
$baseDir string
$mode int
Description:
creates a new virtual drive instance
  • name: VDrive::__construct()
add another drive to repository
bool addDrive (
string $filename, string $baseDir
)
List of parameters:
Name Type Description
$filename string
$baseDir string
Description:
Loads the drive identified by $filename within the directory $baseDir and adds a new mountpoint containing the drive's data to the repository.
  • access: public
  • name: VDrive::addDrive()
get a mountpoint
bool(false)|Mountpoint get (
string $key
)
List of parameters:
Name Type Description
$key string name of the drive to mount
Description:
Returns the mountpoint specified by $key or bool(false) if no such mountpoint exists, or the mountpoint was unable to return any contents.
  • access: public
  • name: VDrive::get()

Redefinition of: FileReadonly::get()

mount an unmounted virtual drive
bool mount (
string $key
)
List of parameters:
Name Type Description
$key string name of the drive to mount
Description:
Mount the mountpoint identified by $key and copies the contents (if any) to the repository.
This function returns bool(true) on success, or bool(false) on error.
  • access: public
  • name: VDrive::mount()
read the virtual drive
bool read ()
Description:
This (re-)loads the virtual drive and (re-)initializes it's contents.
If the file does not exist or is not readable, the functions returns bool(false), else bool(true) is returned.
  • access: public
  • name: VDrive::read()

Redefinition of: FileReadonly::read()

get string represenation of a virtual drive
string toString ()
Description:
This returns a human readable overview of the currently loaded virtual drive and it's contents.
You might want to use this for debugging purposes.
  • access: public
  • name: VDrive::toString()
  • uses: print - "<pre>".$vDrive->toString()."</pre>";

Redefinition of: FileReadonly::toString()

inherited from base classes

Inherited From FileReadonly

Inherited From FileSystemResource

Inherited From Object

Documentation generated on Sat, 03 Jan 2009 22:22:37 +0100 by phpDocumentor 1.4.0

yana author: Thomas MeyerHomepage: www.yanaframework.net