Class VFS_sql_file

Description

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/lib/VFS/sql_file.php,v 1.1.2.3 2009/10/15 17:18:48 jan Exp $

Located in /VFS/lib/VFS/sql_file.php (line 54)

VFS
   |
   --VFS_file
      |
      --VFS_sql_file
Variable Summary
 DB $_db
Method Summary
 mixed copy (string $path, string $name, string $dest, [boolean $autocreate = false])
 mixed createFolder (string $path, string $name)
 mixed deleteFile (string $path, string $name)
 mixed deleteFolder (string $path, string $name, [boolean $recursive = false])
 mixed listFolders ([string $path = ''], [mixed $filter = array()], [boolean $dotfolders = true])
 mixed move (string $path, string $name, string $dest, [boolean $autocreate = false])
 mixed rename (string $oldpath, string $oldname, string $newpath, string $newname)
 mixed write (string $path, string $name, string $tmpFile, [boolean $autocreate = false])
 mixed writeData (string $path, string $name, string $data, [boolean $autocreate = false])
 mixed _listFolder (string $path, [mixed $filter = null], [boolean $dotfiles = true], [boolean $dironly = false])
Variables
DB $_db = false (line 61)

Handle for the current database connection.

Inherited Variables

Inherited from VFS_file

VFS_file::$_permissions

Inherited from VFS

VFS::$_credentials
VFS::$_logger
VFS::$_logLevel
VFS::$_params
VFS::$_vfsSize
Methods
copy (line 177)

Copies a file through the backend.

  • return: True on success or a PEAR_Error object on failure.
mixed copy (string $path, string $name, string $dest, [boolean $autocreate = false])
  • 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?

Redefinition of:
VFS_file::copy()
Copies a file through the backend.
createFolder (line 247)

Creates a folder on the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed createFolder (string $path, string $name)
  • string $path: Holds the path of directory to create folder.
  • string $name: Holds the name of the new folder.

Redefinition of:
VFS_file::createFolder()
Creates a folder on the VFS.
deleteFile (line 395)

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.

Redefinition of:
VFS_file::deleteFile()
Delete a file from the VFS.
deleteFolder (line 345)

Delete a folder from the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed deleteFolder (string $path, string $name, [boolean $recursive = false])
  • string $path: The path to delete the folder from.
  • string $name: The foldername to use.
  • boolean $recursive: Force a recursive delete?

Redefinition of:
VFS_file::deleteFolder()
Delete a folder from the VFS.
listFolders (line 512)

Returns a sorted list of folders in specified directory.

  • return: Folder list on success or a PEAR_Error object on failure.
mixed listFolders ([string $path = ''], [mixed $filter = array()], [boolean $dotfolders = true])
  • 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?

Redefinition of:
VFS_file::listFolders()
Returns a sorted list of folders in specified directory.
move (line 136)

Moves a file in the database and the file system.

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

Redefinition of:
VFS_file::move()
Moves a file in the database and the file system.
rename (line 283)

Rename a file or folder in the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed rename (string $oldpath, string $oldname, string $newpath, 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.

Redefinition of:
VFS_file::rename()
Rename a file or folder in the VFS.
write (line 75)

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.
mixed write (string $path, string $name, string $tmpFile, [boolean $autocreate = false])
  • 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?

Redefinition of:
VFS_file::write()
Store a file in the VFS, with the data copied from a temporary file.
writeData (line 93)

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 $name, string $data, [boolean $autocreate = false])
  • 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?

Redefinition of:
VFS_file::writeData()
Store a file in the VFS from raw data.
_listFolder (line 437)

Return a list of the contents of a folder.

  • return: File list on success or false on failure.
mixed _listFolder (string $path, [mixed $filter = null], [boolean $dotfiles = true], [boolean $dironly = false])
  • string $path: The directory path.
  • mixed $filter: String/hash of items to filter based on filename.
  • boolean $dotfiles: Show dotfiles?
  • boolean $dironly: Show directories only?

Redefinition of:
VFS_file::_listFolder()
Return a list of the contents of a folder.

Inherited Methods

Inherited From VFS_file

 VFS_file::VFS_file()
 VFS_file::changePermissions()
 VFS_file::copy()
 VFS_file::createFolder()
 VFS_file::deleteFile()
 VFS_file::deleteFolder()
 VFS_file::exists()
 VFS_file::isFolder()
 VFS_file::listFolders()
 VFS_file::move()
 VFS_file::read()
 VFS_file::readByteRange()
 VFS_file::readFile()
 VFS_file::readStream()
 VFS_file::rename()
 VFS_file::size()
 VFS_file::write()
 VFS_file::writeData()
 VFS_file::_listFolder()

Inherited From VFS

 VFS::VFS()
 VFS::autocreatePath()
 VFS::changePermissions()
 VFS::checkCredentials()
 VFS::copy()
 VFS::createFolder()
 VFS::delete()
 VFS::deleteFile()
 VFS::deleteFolder()
 VFS::emptyFolder()
 VFS::exists()
 VFS::factory()
 VFS::getCurrentDirectory()
 VFS::getFolderSize()
 VFS::getModifiablePermissions()
 VFS::getParam()
 VFS::getQuota()
 VFS::getRequiredCredentials()
 VFS::getVFSSize()
 VFS::isFolder()
 VFS::listFolder()
 VFS::listFolders()
 VFS::log()
 VFS::move()
 VFS::read()
 VFS::readByteRange()
 VFS::readFile()
 VFS::rename()
 VFS::setLogger()
 VFS::setParams()
 VFS::setQuota()
 VFS::setQuotaRoot()
 VFS::singleton()
 VFS::size()
 VFS::strlen()
 VFS::strtolower()
 VFS::write()
 VFS::writeData()
 VFS::_copyRecursive()
 VFS::_getPath()
 VFS::_getTempDir()
 VFS::_getTempFile()
 VFS::_listFolder()

Documentation generated on Sun, 30 Jan 2011 05:22:09 +0000 by phpDocumentor 1.4.3