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

Class: VFS_Object

Source Location: /VFS-0.1.0/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 19]
A wrapper for the VFS class to return objects, instead of arrays.

$Horde: framework/VFS/VFS/Object.php,v 1.21 2006/01/01 21:10:23 jan Exp $

Copyright 2002-2006 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 52]

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 261]

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 112]

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 204]

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 177]

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 216]

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 72]

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 ]

getFileSize   [line 308]

integer getFileSize( string $path, string $name)

Returns the size of a file.
  • Return: The size of the file in bytes or PEAR_Error on failure.
  • Access: public

Parameters:

string   $path   —  The filename.
string   $name   —  UNUSED

[ Top ]

getModifiablePermissions   [line 282]

array getModifiablePermissions( )

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

[ Top ]

getRequiredCredentials   [line 271]

array getRequiredCredentials( )

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

[ Top ]

listFolder   [line 232]

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 135]

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 192]

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 123]

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

Set configuration parameters.

Parameters:

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

[ Top ]

singleton   [line 99]

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 150]

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 164]

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 14:39:00 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.