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

Class: VFS_file

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

Class Overview

VFS
   |
   --VFS_file

VFS implementation for a standard filesystem.


Author(s):

  • Chuck Hagenbuch

Methods


Child classes:

VFS_sql_file
VFS:: implementation using PHP's PEAR database abstraction layer and local file system for file storage.

Inherited Variables

Inherited Methods

Class: VFS

VFS::VFS()
Constructor.
VFS::autocreatePath()
Automatically creates any necessary parent directories in the specified $path.
VFS::changePermissions()
Changes permissions for an item on the VFS.
VFS::checkCredentials()
Checks the credentials that we have by calling _connect(), to see if there is a valid login.
VFS::copy()
Copies a file through the backend.
VFS::createFolder()
Creates a folder in the VFS.
VFS::delete()
Alias to deleteFile()
VFS::deleteFile()
Deletes a file from the VFS.
VFS::deleteFolder()
Deletes a folder from the VFS.
VFS::emptyFolder()
Recursively remove all files and subfolders from the given folder.
VFS::exists()
Returns if a given file or folder exists in a folder.
VFS::factory()
Attempts to return a concrete VFS instance based on $driver.
VFS::getCurrentDirectory()
Returns the current working directory of the VFS backend.
VFS::getFolderSize()
Returns the size of a folder
VFS::getModifiablePermissions()
Returns an array specifying what permissions are changeable for this VFS implementation.
VFS::getParam()
Returns configuration parameters.
VFS::getQuota()
Get quota information (used/allocated), in bytes.
VFS::getRequiredCredentials()
Returns the list of additional credentials required, if any.
VFS::getVFSSize()
Returns the size of the VFS item.
VFS::isFolder()
Checks if a given item is a folder.
VFS::listFolder()
Returns a file list of the directory passed in.
VFS::listFolders()
Returns a sorted list of folders in the specified directory.
VFS::log()
Logs a message if a PEAR Log object is available, and the message's priority is lower than or equal to the configured log level.
VFS::move()
Moves a file through the backend.
VFS::read()
Retrieves a file from the VFS.
VFS::readByteRange()
Retrieves a part of a file from the VFS. Particularly useful when reading large files which would exceed the PHP memory limits if they were stored in a string.
VFS::readFile()
Retrieves a file from the VFS as an on-disk local file.
VFS::rename()
Renames a file in the VFS.
VFS::setLogger()
Sets the PEAR Log object used to log informational or error messages.
VFS::setParams()
Sets configuration parameters.
VFS::setQuota()
Sets the VFS quota limit.
VFS::setQuotaRoot()
Sets the VFS quota root.
VFS::singleton()
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.
VFS::size()
Retrieves the size of a file from the VFS.
VFS::strlen()
Returns the character (not byte) length of a string.
VFS::strtolower()
Converts a string to all lowercase characters ignoring the current locale.
VFS::write()
Stores a file in the VFS.
VFS::writeData()
Stores a file in the VFS from raw data.
VFS::_copyRecursive()
Recursively copies a directory through the backend.
VFS::_getPath()
Returns the full path of an item.
VFS::_getTempDir()
Determines the location of the system temporary directory.
VFS::_getTempFile()
Creates a temporary file.

Class Details

[line 22]
VFS implementation for a standard filesystem.

Required parameters:

   'vfsroot'  The root path

Note: The user that your webserver runs as (commonly 'nobody', 'apache', or 'www-data') MUST have read/write permission to the directory you specify as the 'vfsroot'.

$Horde: framework/VFS/lib/VFS/file.php,v 1.1.2.6 2009/10/15 17:18:48 jan Exp $

Copyright 2002-2009 The Horde Project (http://www.horde.org/)

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

  • Author: Chuck Hagenbuch


[ Top ]


Method Detail

VFS_file (Constructor)   [line 41]

VFS_file VFS_file( [array $params = array()])

Constructs a new Filesystem based VFS object.

Parameters:

array   $params   —  A hash containing connection parameters.

[ Top ]

changePermissions   [line 456]

mixed changePermissions( string $path, string $name, integer $permission)

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

Overrides VFS::changePermissions() (Changes permissions for an item on the VFS.)

Parameters:

string   $path   —  The path of directory of the item.
string   $name   —  The name of the item.
integer   $permission   —  The octal value of the new permission.

[ Top ]

copy   [line 268]

mixed copy( string $path, string $name, string $dest, [boolean $autocreate = false])

Copies a file through the backend.
  • Return: True on success or a PEAR_Error object on failure.

Overridden in child classes as:

VFS_sql_file::copy()
Copies a file through the backend.

Overrides VFS::copy() (Copies a file through the backend.)

Parameters:

string   $path   —  The path to store the file in.
string   $name   —  The filename to use.
string   $dest   —  The destination of the file.
boolean   $autocreate   —  Automatically create directories?

[ Top ]

createFolder   [line 425]

mixed createFolder( string $path, string $name)

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

Overridden in child classes as:

VFS_sql_file::createFolder()
Creates a folder on the VFS.

Overrides VFS::createFolder() (Creates a folder in the VFS.)

Parameters:

string   $path   —  The path to create the folder in.
string   $name   —  The foldername to use.

[ Top ]

deleteFile   [line 369]

mixed deleteFile( string $path, string $name)

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

Overridden in child classes as:

VFS_sql_file::deleteFile()
Delete a file from the VFS.

Overrides VFS::deleteFile() (Deletes a file from the VFS.)

Parameters:

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

[ Top ]

deleteFolder   [line 392]

mixed deleteFolder( string $path, string $name, [boolean $recursive = false])

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

Overridden in child classes as:

VFS_sql_file::deleteFolder()
Delete a folder from the VFS.

Overrides VFS::deleteFolder() (Deletes a folder from the VFS.)

Parameters:

string   $path   —  The path to delete the folder from.
string   $name   —  The foldername to use.
boolean   $recursive   —  Force a recursive delete?

[ Top ]

exists   [line 706]

boolean exists( string $path, string $name)

Returns if a given file or folder exists in a folder.
  • Return: True if it exists, false otherwise.

Overrides VFS::exists() (Returns if a given file or folder exists in a folder.)

Parameters:

string   $path   —  The path to the folder.
string   $name   —  The file or folder name.

[ Top ]

isFolder   [line 442]

boolean isFolder( string $path, string $name)

Check if a given pathname is a folder.
  • Return: True if it is a folder, false otherwise.

Overrides VFS::isFolder() (Checks if a given item is a folder.)

Parameters:

string   $path   —  The path to the folder.
string   $name   —  The file/folder name.

[ Top ]

listFolders   [line 604]

mixed listFolders( [string $path = ''], [mixed $filter = null], [boolean $dotfolders = true])

Returns a sorted list of folders in specified directory.
  • Return: Folder list on success or a PEAR_Error object on failure.

Overridden in child classes as:

VFS_sql_file::listFolders()
Returns a sorted list of folders in specified directory.

Overrides VFS::listFolders() (Returns a sorted list of folders in the specified directory.)

Parameters:

string   $path   —  The path of the directory to get the directory list for.
mixed   $filter   —  Hash of items to filter based on folderlist.
boolean   $dotfolders   —  Include dotfolders?

[ Top ]

move   [line 227]

mixed move( string $path, string $name, string $dest, [boolean $autocreate = false])

Moves a file in the database and the file system.
  • Return: True on success or a PEAR_Error object on failure.

Overridden in child classes as:

VFS_sql_file::move()
Moves a file in the database and the file system.

Overrides VFS::move() (Moves a file through the backend.)

Parameters:

string   $path   —  The path to store the file in.
string   $name   —  The filename to use.
string   $dest   —  The destination of the file.
boolean   $autocreate   —  Automatically create directories?

[ Top ]

read   [line 78]

string read( string $path, string $name)

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

Overrides VFS::read() (Retrieves a file from the VFS.)

Parameters:

string   $path   —  The pathname to the file.
string   $name   —  The filename to retrieve.

[ Top ]

readByteRange   [line 145]

string readByteRange( string $path, string $name, &$offset, [integer $length = -1], &$remaining, integer $offset, integer $remaining)

Retrieves a part of a file from the VFS. Particularly useful when reading large files which would exceed the PHP memory limits if they were stored in a string.
  • Return: The file data.
  • Abstract:

Overrides VFS::readByteRange() (Retrieves a part of a file from the VFS. Particularly useful when reading large files which would exceed the PHP memory limits if they were stored in a string.)

Parameters:

string   $path   —  The pathname to the file.
string   $name   —  The filename to retrieve.
integer   $offset   —  The offset of the part. (The new offset will be stored in here).
integer   $length   —  The length of the part. If the length = -1, the whole part after the offset is retrieved. If more bytes are given as exists after the given offset. Only the available bytes are read.
integer   $remaining   —  The bytes that are left, after the part that is retrieved.
   &$offset   — 
   &$remaining   — 

[ Top ]

readFile   [line 100]

string readFile( string $path, string $name)

Retrieves a file from the VFS as an on-disk local file.

This function provides a file on local disk with the data of a VFS file in it. This file <em>cannot</em> be modified! The behavior if you do modify it is undefined. It will be removed at the end of the request.

  • Return: A local filename.

Overrides VFS::readFile() (Retrieves a file from the VFS as an on-disk local file.)

Parameters:

string   $path   —  The pathname to the file.
string   $name   —  The filename to retrieve.

[ Top ]

readStream   [line 113]

resource readStream( string $path, string $name)

Open a read-only stream to a file in the VFS.
  • Return: The stream.

Parameters:

string   $path   —  The pathname to the file.
string   $name   —  The filename to retrieve.

[ Top ]

rename   [line 682]

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

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

Overridden in child classes as:

VFS_sql_file::rename()
Rename a file or folder in the VFS.

Overrides VFS::rename() (Renames a file in the VFS.)

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 ]

size   [line 61]

integer size( string $path, string $name)

Retrieves the filesize from the VFS.
  • Return: The file size.

Overrides VFS::size() (Retrieves the size of a file from the VFS.)

Parameters:

string   $path   —  The pathname to the file.
string   $name   —  The filename to retrieve.

[ Top ]

write   [line 188]

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

Store a file in the VFS, with the data copied from a temporary file.
  • Return: True on success or a PEAR_Error object on failure.

Overridden in child classes as:

VFS_sql_file::write()
Store a file in the VFS, with the data copied from a temporary file.

Overrides VFS::write() (Stores a file in the VFS.)

Parameters:

string   $path   —  The path to store the file in.
string   $name   —  The filename to use.
string   $tmpFile   —  The temporary file containing the data to be stored.
boolean   $autocreate   —  Automatically create directories?

[ Top ]

writeData   [line 314]

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

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

Overridden in child classes as:

VFS_sql_file::writeData()
Store a file in the VFS from raw data.

Overrides VFS::writeData() (Stores a file in the VFS from raw data.)

Parameters:

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

[ Top ]


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