VFS
[ class tree: VFS ] [ index: VFS ] [ all elements ]

Class: VFS_Object

Source Location: /VFS-0.3.0/lib/VFS/Object.php

Class Overview


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


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 18]
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.



[ Top ]


Method Detail

VFS_Object (Constructor)   [line 51]

VFS_Object VFS_Object( VFS &$vfs)

Constructor.

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


Parameters:

VFS   &$vfs   —  The VFS object to wrap.

[ Top ]

changePermissions   [line 260]

mixed changePermissions( string $path, string $permission)

Changes permissions for an Item on the VFS.
  • Return: True on success or a PEAR_Error object on failure.

Parameters:

string   $path   —  Holds the path of directory of the Item.
string   $permission   —  TODO

[ Top ]

checkCredentials   [line 111]

mixed checkCredentials( )

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.

[ Top ]

createFolder   [line 203]

mixed createFolder( string $path)

Create a folder in the VFS.
  • Return: True on success or a PEAR_Error object on failure.

Parameters:

string   $path   —  The path to the folder.

[ Top ]

deleteFile   [line 176]

mixed deleteFile( string $path, string $name)

Delete a file from the VFS.
  • Return: True on success or a PEAR_Error object on failure.

Parameters:

string   $path   —  The path to store the file in.
string   $name   —  The filename to use.

[ Top ]

deleteFolder   [line 215]

mixed deleteFolder( string $path)

Deletes a folder from the VFS.
  • Return: True on success or a PEAR_Error object on failure.

Parameters:

string   $path   —  The path of the folder to delete.

[ Top ]

factory   [line 71]

VFS_Object &factory( mixed $driver, [array $params = array()])

Attempts to return a concrete VFS_Object instance based on $driver.
  • Return: The newly created concrete VFS_Object instance, or false on an error.

Parameters:

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.

[ Top ]

getModifiablePermissions   [line 281]

array getModifiablePermissions( )

Return the array specificying what permissions are changeable for this implementation.
  • Return: Changeable permisions.

[ Top ]

getRequiredCredentials   [line 270]

array getRequiredCredentials( )

Return the list of additional credentials required, if any.
  • Return: Credential list.

[ Top ]

listFolder   [line 231]

mixed listFolder( string $path)

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.

Parameters:

string   $path   —  The path of the diretory.

[ Top ]

read   [line 134]

string read( string $path)

Retrieve a file from the VFS.
  • Return: The file data.

Parameters:

string   $path   —  The pathname to the file.

[ Top ]

rename   [line 191]

mixed rename( string $oldpath, string $newpath, string $oldname, string $newname)

Rename a file in the VFS.
  • Return: True on success or a PEAR_Error object on failure.

Parameters:

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.

[ Top ]

setParams   [line 122]

void setParams( [array $params = array()])

Set configuration parameters.

Parameters:

array   $params   —  An associative array of parameter name/value pairs.

[ Top ]

singleton   [line 98]

VFS_Object &singleton( mixed $driver, [array $params = array()])

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.

Parameters:

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.

[ Top ]

write   [line 149]

mixed write( string $path, string $tmpFile, [boolean $autocreate = false])

Store a file in the VFS.
  • Return: True on success or a PEAR_Error object on failure.

Parameters:

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?

[ Top ]

writeData   [line 163]

mixed writeData( string $path, string $data, [boolean $autocreate = false])

Store a file in the VFS from raw data.
  • Return: True on success or a PEAR_Error object on failure.

Parameters:

string   $path   —  The path to store the file in.
string   $data   —  The file data.
boolean   $autocreate   —  Automatically create directories?

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:34:55 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.