>> YANA 4 PHP Framework >> Docs For Class VDrive

Class VDrive

Description

virtual Drive

Class to abstract from real filesystems by mapping filenames to aliases (mountpoints). Mountpoints my 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.

  • name: VDrive
  • access: public

Located in /includes/class_vdrive.php

Object
   |
   --InputStream
      |
      --SecureInputStream
         |
         --VDrive
Method Summary
  • VDrive VDrive (string $path, [array $options = array()], [string $baseDir = ""], int $mode)
  • bool addDrive (string $filename,  $baseDir, int $mode)
  • 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,  $baseDir, int $mode
)
List of parameters:
Name Type Description
$filename string
$mode int
$baseDir
Description:

Loads the drive identified by $filename within the directory $baseDir and adds a new mountpoint containing the drive's data to the repository.

  • name: VDrive::addDrive()
  • access: public
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.

  • name: VDrive::get()
  • access: public

Redefinition of: SecureInputStream::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.

  • name: VDrive::mount()
  • access: public
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.

  • name: VDrive::read()
  • access: public

Redefinition of: SecureInputStream::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.

  • name: VDrive::toString()
  • access: public
  • uses: print - "<pre>".$vDrive->toString()."</pre>";

Redefinition of: SecureInputStream::toString()

inherited from base classes

Inherited From SecureInputStream

Inherited From InputStream

Inherited From Object

Documentation generated on Sun, 11 Mar 2007 15:02:50 +0100 by phpDocumentor 1.3.1

yana author: Thomas MeyerHomepage: www.yanaframework.net