Class VFS_Object

Description

A wrapper for the VFS class to return objects, instead of arrays.

$Horde: framework/VFS/lib/VFS/Object.php,v 1.1.2.1 2007/12/20 13:50:21 jan Exp $

Copyright 2002-2007 Jon Wood <jon@jellybob.co.uk>

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /VFS/lib/VFS/Object.php (line 18)


	
			
Variable Summary
Method Summary
 VFS_Object VFS_Object (VFS &$vfs)
 mixed changePermissions (string $path, string $permission)
 mixed checkCredentials ()
 mixed createFolder (string $path)
 mixed deleteFile (string $path, string $name)
 mixed deleteFolder (string $path)
 VFS_Object &factory (mixed $driver, [array $params = array()])
 mixed listFolder (string $path)
 string read (string $path)
 mixed rename (string $oldpath, string $newpath, string $oldname, string $newname)
 void setParams ([array $params = array()])
 VFS_Object &singleton (mixed $driver, [array $params = array()])
 mixed write (string $path, string $tmpFile, [boolean $autocreate = false])
 mixed writeData (string $path, string $data, [boolean $autocreate = false])
Variables
string $_currentPath (line 33)

The current path that has been passed to listFolder, if this changes, the list will be rebuilt.

array $_folderList (line 41)

The return value from a standard VFS listFolder call, to be read with the Object listFolder.

VFS $_vfs (line 25)

The actual vfs that does the work

Methods
Constructor VFS_Object (line 51)

Constructor.

If you pass in an existing VFS object, it will be used as the VFS object for this object.

VFS_Object VFS_Object (VFS &$vfs)
  • VFS &$vfs: The VFS object to wrap.
changePermissions (line 260)

Changes permissions for an Item on the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed changePermissions (string $path, string $permission)
  • string $path: Holds the path of directory of the Item.
  • string $permission: TODO
checkCredentials (line 111)

Check the credentials that we have to see if there is a valid login.

  • return: True on success, PEAR_Error describing the problem if the credentials are invalid.
mixed checkCredentials ()
createFolder (line 203)

Create a folder in the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed createFolder (string $path)
  • string $path: The path to the folder.
deleteFile (line 176)

Delete a file from the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed deleteFile (string $path, string $name)
  • string $path: The path to store the file in.
  • string $name: The filename to use.
deleteFolder (line 215)

Deletes a folder from the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed deleteFolder (string $path)
  • string $path: The path of the folder to delete.
factory (line 71)

Attempts to return a concrete VFS_Object instance based on $driver.

  • return: The newly created concrete VFS_Object instance, or false on an error.
VFS_Object &factory (mixed $driver, [array $params = array()])
  • mixed $driver: The type of concrete VFS subclass to return. If $driver is an array then we will look in $driver[0]/lib/VFS/ for the subclass implementation named $driver[1].php.
  • array $params: A hash containing any additional configuration or connection parameters a subclass might need.
getModifiablePermissions (line 281)

Return the array specificying what permissions are changeable for this implementation.

  • return: Changeable permisions.
array getModifiablePermissions ()
getRequiredCredentials (line 270)

Return the list of additional credentials required, if any.

  • return: Credential list.
array getRequiredCredentials ()
listFolder (line 231)

Returns a VFS_ListItem object if the folder can be read, or a PEAR_Error if it can't be. Returns false once the folder has been completely read.

  • return: File list (array) on success, a PEAR_Error object on failure, or false if the folder is completely read.
mixed listFolder (string $path)
  • string $path: The path of the diretory.
read (line 134)

Retrieve a file from the VFS.

  • return: The file data.
string read (string $path)
  • string $path: The pathname to the file.
rename (line 191)

Rename a file in the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed rename (string $oldpath, string $newpath, string $oldname, string $newname)
  • string $oldpath: The old path to the file.
  • string $oldname: The old filename.
  • string $newpath: The new path of the file.
  • string $newname: The new filename.
setParams (line 122)

Set configuration parameters.

void setParams ([array $params = array()])
  • array $params: An associative array of parameter name/value pairs.
singleton (line 98)

Attempts to return a reference to a concrete VFS instance based on $driver. It will only create a new instance if no VFS instance with the same parameters currently exists.

This should be used if multiple types of file backends (and, thus, multiple VFS instances) are required.

This method must be invoked as: $var = &VFS::singleton()

  • return: The concrete VFS_Object reference, or false on error.
VFS_Object &singleton (mixed $driver, [array $params = array()])
  • mixed $driver: The type of concrete VFS subclass to return. If $driver is an array then we will look in $driver[0]/lib/VFS/ for the subclass implementation named $driver[1].php.
  • array $params: A hash containing any additional configuration or connection parameters a subclass might need.
write (line 149)

Store a file in the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed write (string $path, string $tmpFile, [boolean $autocreate = false])
  • string $path: The path to store the file in.
  • string $tmpFile: The temporary file containing the data to be stored.
  • boolean $autocreate: Automatically create directories?
writeData (line 163)

Store a file in the VFS from raw data.

  • return: True on success or a PEAR_Error object on failure.
mixed writeData (string $path, string $data, [boolean $autocreate = false])
  • string $path: The path to store the file in.
  • string $data: The file data.
  • boolean $autocreate: Automatically create directories?

Documentation generated on Sun, 30 Jan 2011 05:20:06 +0000 by phpDocumentor 1.4.3