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

Class: VFS_sql_file

Source Location: /VFS-0.1.0/VFS/sql_file.php

Class Overview

VFS
   |
   --VFS_sql_file

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


Author(s):

Methods


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::deleteFile()
Deletes a file from the VFS.
VFS::deleteFolder()
Deletes a folder from the VFS.
VFS::emptyFolder()
Removes recursively 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::getFileSize()
Returns the size of a file.
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::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 45]
VFS:: implementation using PHP's PEAR database abstraction layer and local file system for file storage.

Required values for $params:

      'phptype'       The database type (ie. 'pgsql', 'mysql', etc.).
      'vfsroot'       The root directory of where the files should be
                      actually stored.

Optional values:

      'table'         The name of the vfs table in 'database'. Defaults to
                      'horde_vfs'.

Required by some database implementations:

      'hostspec'      The hostname of the database server.
      'protocol'      The communication protocol ('tcp', 'unix', etc.).
      'database'      The name of the database.
      'username'      The username with which to connect to the database.
      'password'      The password associated with 'username'.
      'options'       Additional options to pass to the database.
      'tty'           The TTY on which to connect to the database.
      'port'          The port on which to connect to the database.

The table structure for the VFS can be found in data/vfs.sql.

$Horde: framework/VFS/VFS/sql_file.php,v 1.68 2006/03/30 08:03:09 selsky Exp $



[ Top ]


Method Detail

copy   [line 211]

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.

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

mixed createFolder( string $path, string $name)

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

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

Parameters:

string   $path   —  Holds the path of directory to create folder.
string   $name   —  Holds the name of the new folder.

[ Top ]

deleteFile   [line 424]

mixed deleteFile( string $path, string $name)

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

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

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.

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 ]

getFileSize   [line 897]

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

Overrides VFS::getFileSize() (Returns the size of a file.)

Parameters:

string   $path   —  The path of the file.
string   $name   —  The filename.

[ Top ]

listFolders   [line 541]

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

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

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   —  String/hash of items to filter based on folderlist.
boolean   $dotfolders   —  Include dotfolders?

[ Top ]

move   [line 165]

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.

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

Parameters:

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

[ Top ]

read   [line 62]

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 ]

rename   [line 312]

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.

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 ]

write   [line 97]

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

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.

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

mixed writeData( string $path, string $name, 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.

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