>> 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.

  • access: public

Located in /includes/class_vdrive.php

SerializeableObject
   |
   --InputStream
      |
      --SecureInputStream
         |
         --VDrive

Direct descendents

Class Description
Registry Registry

Method Summary

VDrive VDrive (string $filename, array $OPTIONS, string $baseDir, int $mode)
bool addDrive (string $filename, mixed $baseDir, int $mode)
bool(false)|Mountpoint get (string $key)
bool mount (string $key)
bool read ()
string toString ()

Methods

Constructor VDrive
VDrive VDrive (string $filename, array $OPTIONS, string $baseDir, int $mode)

constructor

creates a new virtual drive instance

  • name: vdrive::__construct()
Name Type Description
$filename string
$OPTIONS array
$baseDir string
$mode int
addDrive
bool addDrive (string $filename, mixed $baseDir, int $mode)

add another drive to repository

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
Name Type Description
$filename string
$mode int
get
bool(false)|Mountpoint get (string $key)

get a mountpoint

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
Name Type Description
$key string name of the drive to mount

Redefinition of:
SecureInputStream::get()
get
mount
bool mount (string $key)

mount an unmounted virtual drive

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
Name Type Description
$key string name of the drive to mount
read
bool read ()

read the virtual drive

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()
read
toString
string toString ()

get string represenation of a virtual drive

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()
toString

Inherited Methods

Inherited From SecureInputStream

SecureInputStream::checksum()
SecureInputStream::failSafeRead()
SecureInputStream::get()
SecureInputStream::isEmpty()
SecureInputStream::read()
SecureInputStream::reset()
SecureInputStream::toString()

Inherited From InputStream

InputStream::InputStream()
InputStream::exists()
InputStream::get()
InputStream::getFilename()
InputStream::isEmpty()
InputStream::read()
InputStream::resetStats()
InputStream::toString()

Inherited From SerializeableObject

SerializeableObject::serialize()
SerializeableObject::toString()

Documentation generated on Sat, 16 Sep 2006 17:06:12 +0200 by phpDocumentor 1.3.0RC4

yana author: Thomas MeyerHomepage: www.all-community.de/pub