[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/VFS/ -> sql_file.php (sommaire)

File value for vfs_type column.

Poids: 883 lignes (30 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

VFS_sql_file:: (21 méthodes):
  size()
  read()
  write()
  writeData()
  move()
  copy()
  createFolder()
  rename()
  deleteFolder()
  deleteFile()
  _listFolder()
  listFolders()
  _recursiveCopy()
  _writeSQLData()
  _recursiveSQLRename()
  _recursiveSQLDelete()
  _recursiveLFSDelete()
  _connect()
  _disconnect()
  _getNativePath()
  _getSQLNativePath()


Classe: VFS_sql_file  - X-Ref

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

Required values for $params:<pre>
'phptype'       The database type (ie. 'pgsql', 'mysql', etc.).
'vfsroot'       The root directory of where the files should be
actually stored.</pre>

Optional values:<pre>
'table'         The name of the vfs table in 'database'. Defaults to
'horde_vfs'.</pre>

Required by some database implementations:<pre>
'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.</pre>

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

$Horde: framework/VFS/VFS/sql_file.php,v 1.44.4.22 2006/05/31 04:50:02 slusarz Exp $

size($path, $name)   X-Ref
Returns the size of a file.

param: string $path  The path of the file.
param: string $name  The filename.
return: integer  The size of the file in bytes or PEAR_Error on

read($path, $name)   X-Ref
Retrieve a file from the VFS.

param: string $path  The pathname to the file.
param: string $name  The filename to retrieve.
return: string  The file data.

write($path, $name, $tmpFile, $autocreate = false)   X-Ref
Store a file in the VFS, with the data copied from a temporary
file.

param: string $path         The path to store the file in.
param: string $name         The filename to use.
param: string $tmpFile      The temporary file containing the data to be
param: boolean $autocreate  Automatically create directories?
return: mixed  True on success or a PEAR_Error object on failure.

writeData($path, $name, $data, $autocreate = false)   X-Ref
Store a file in the VFS from raw data.

param: string $path         The path to store the file in.
param: string $name         The filename to use.
param: string $data         The file data.
param: boolean $autocreate  Automatically create directories?
return: mixed  True on success or a PEAR_Error object on failure.

move($path, $name, $dest)   X-Ref
Moves a file in the database and the file system.

param: string $path  The path to store the file in.
param: string $name  The old filename.
param: string $dest  The new filename.
return: mixed  True on success or a PEAR_Error object on failure.

copy($path, $name, $dest)   X-Ref
Copies a file through the backend.

param: string $path  The path to store the file in.
param: string $name  The filename to use.
param: string $dest  The destination of the file.
return: mixed  True on success or a PEAR_Error object on failure.

createFolder($path, $name)   X-Ref
Creates a folder on the VFS.

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

rename($oldpath, $oldname, $newpath, $newname)   X-Ref
Rename a file or folder in the VFS.

param: string $oldpath  The old path to the file.
param: string $oldname  The old filename.
param: string $newpath  The new path of the file.
param: string $newname  The new filename.
return: mixed  True on success or a PEAR_Error object on failure.

deleteFolder($path, $name, $recursive = false)   X-Ref
Delete a folder from the VFS.

param: string $path        The path to delete the folder from.
param: string $name        The foldername to use.
param: boolean $recursive  Force a recursive delete?
return: mixed  True on success or a PEAR_Error object on failure.

deleteFile($path, $name)   X-Ref
Delete a file from the VFS.

param: string $path  The path to store the file in.
param: string $name  The filename to use.
return: mixed  True on success or a PEAR_Error object on failure.

_listFolder($path, $filter = null, $dotfiles = true,$dironly = false)   X-Ref
Return a list of the contents of a folder.

param: string $path       The directory path.
param: mixed $filter      String/hash of items to filter based on
param: boolean $dotfiles  Show dotfiles?
param: boolean $dironly   Show directories only?
return: mixed  File list on success or false on failure.

listFolders($path = '', $filter = array()   X-Ref
Returns a sorted list of folders in specified directory.

param: string $path         The path of the directory to get the
param: mixed $filter        String/hash of items to filter based on
param: boolean $dotfolders  Include dotfolders?
return: mixed  Folder list on success or a PEAR_Error object on failure.

_recursiveCopy($path, $name, $dest)   X-Ref
Recursively copies the contents of a folder to a destination.

param: string $path  The path to store the directory in.
param: string $name  The name of the directory.
param: string $dest  The destination of the directory.
return: mixed  True on success or a PEAR_Error object on failure.

_writeSQLData($path, $name, $autocreate = false)   X-Ref
Store a files information within the database.

param: string $path         The path to store the file in.
param: string $name         The filename to use.
param: boolean $autocreate  Automatically create directories?
return: mixed  True on success or a PEAR_Error object on failure.

_recursiveSQLRename($oldpath, $oldname, $newpath, $newname)   X-Ref
Renames all child paths.

param: string $oldpath  The old path of the folder to rename.
param: string $oldname  The old name.
param: string $newpath  The new path of the folder to rename.
param: string $newname  The new name.
return: mixed  True on success or a PEAR_Error object on failure.

_recursiveSQLDelete($path, $name)   X-Ref
Delete a folders contents from the VFS in the SQL database,
recursively.

param: string $path  The path of the folder.
param: string $name  The foldername to use.
return: mixed  True on success or a PEAR_Error object on failure.

_recursiveLFSDelete($path, $name)   X-Ref
Delete a folders contents from the VFS, recursively.

param: string $path  The path of the folder.
param: string $name  The foldername to use.
return: mixed  True on success or a PEAR_Error object on failure.

_connect()   X-Ref
Attempts to open a persistent connection to the SQL server.

return: mixed  True on success or a PEAR_Error object on failure.

_disconnect()   X-Ref
Disconnect from the SQL server and clean up the connection.


_getNativePath($path, $name)   X-Ref
Return a full filename on the native filesystem, from a VFS
path and name.

param: string $path  The VFS file path.
param: string $name  The VFS filename.
return: string  The full native filename.

_getSQLNativePath($path, $name)   X-Ref
Return a full SQL filename on the native filesystem, from a VFS
path and name.

param: string $path  The VFS file path.
param: string $name  The VFS filename.
return: string  The full native filename.



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7