Class VFS_musql

Description

Multi User VFS implementation for PHP's PEAR database abstraction layer.

Required values for $params:

      'phptype'       The database type (ie. 'pgsql', 'mysql', etc.).

Optional values:

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

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.

Known Issues: Delete is not recusive, so files and folders that used to be in a folder that gets deleted live forever in the database, or re-appear when the folder is recreated. Rename has the same issue, so files are lost if a folder is renamed.

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

Database specific notes:

MSSQL:

  • The vfs_data field must be of type IMAGE.
  • You need the following php.ini settings:
    1.     Valid range 2147483647. Default 4096.
    2.     mssql.textlimit zero to pass through
    3.  
    4.     Valid range 2147483647. Default 4096.
    5.     mssql.textsize zero to pass through
$Horde: framework/VFS/lib/VFS/musql.php,v 1.1.2.4 2009/01/06 15:23:47 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.

Located in /VFS/lib/VFS/musql.php (line 69)

VFS
   |
   --VFS_sql
      |
      --VFS_musql
Variable Summary
Method Summary
 mixed changePermissions (string $path, string $name,  $permission)
 mixed createFolder (string $path, string $name)
 mixed deleteFile (string $path, string $name)
 mixed deleteFolder (string $path, string $name, [boolean $recursive = false])
 mixed rename (string $oldpath, string $oldname, string $newpath, string $newname)
 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
array $_permissions = array(
'owner' => array('read' => false, 'write' => false, 'execute' => false),'group'=>array('read'=>false,'write'=>false,'execute'=>false),'all'=>array('read'=>true,'write'=>true,'execute'=>false))
(line 76)

List of permissions and if they can be changed in this VFS


Redefinition of:
VFS::$_permissions
List of permissions and if they can be changed in this VFS backend.

Inherited Variables

Inherited from VFS_sql

VFS_sql::$_connected
VFS_sql::$_db
VFS_sql::$_write_db

Inherited from VFS

VFS::$_credentials
VFS::$_logger
VFS::$_logLevel
VFS::$_params
VFS::$_vfsSize
Methods
changePermissions (line 508)

Changes permissions for an Item on the VFS.

  • return: True on success or a PEAR_Error object on failure.
mixed changePermissions (string $path, string $name,  $permission)
  • string $path: Holds the path of directory of the Item.
  • string $name: Holds the name of the Item.
  • $permission

Redefinition of:
VFS::changePermissions()
Changes permissions for an item on the VFS.
createFolder (line 283)

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_sql::createFolder()
Creates a folder on the VFS.
deleteFile (line 160)

Deletes 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_sql::deleteFile()
Delete a file from the VFS.
deleteFolder (line 352)

Deletes 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_sql::deleteFolder()
Delete a folder from the VFS.
rename (line 217)

Renames 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_sql::rename()
Rename a file or folder in the VFS.
writeData (line 92)

Stores 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_sql::writeData()
Store a file in the VFS from raw data.
_listFolder (line 427)

Returns 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 path of the directory.
  • mixed $filter: String/hash to filter file/dirname on.
  • boolean $dotfiles: Show dotfiles?
  • boolean $dironly: Show only directories?

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

Inherited Methods

Inherited From VFS_sql

 VFS_sql::createFolder()
 VFS_sql::deleteFile()
 VFS_sql::deleteFolder()
 VFS_sql::gc()
 VFS_sql::getFolderSize()
 VFS_sql::isFolder()
 VFS_sql::listFolders()
 VFS_sql::read()
 VFS_sql::readByteRange()
 VFS_sql::rename()
 VFS_sql::size()
 VFS_sql::write()
 VFS_sql::writeData()
 VFS_sql::_getFileSizeOp()
 VFS_sql::_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:19:50 +0000 by phpDocumentor 1.4.3