[ Index ]
 

Code source de Horde 3.1.3

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

title

Body

[fermer]

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

(pas de description)

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

Définit 1 class

VFS_file:: (19 méthodes):
  VFS_file()
  size()
  read()
  readByteRange()
  write()
  move()
  copy()
  writeData()
  deleteFile()
  deleteFolder()
  createFolder()
  isFolder()
  changePermissions()
  _listFolder()
  listFolders()
  _getUnixPerms()
  rename()
  _getNativePath()
  _connect()


Classe: VFS_file  - X-Ref

VFS implementation for a standard filesystem.

Required parameters:<pre>
'vfsroot'  The root path</pre>

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/VFS/file.php,v 1.63.4.21 2006/05/31 04:50:02 slusarz Exp $

Copyright 2002-2006 Chuck Hagenbuch <chuck@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.

VFS_file($params = array()   X-Ref
Constructs a new Filesystem based VFS object.

param: array $params  A hash containing connection parameters.

size($path, $name)   X-Ref
Retrieves the filesize from the VFS.

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

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.

readByteRange($path, $name, &$offset, $length = -1, &$remaining)   X-Ref
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.

param: string  $path       The pathname to the file.
param: string  $name       The filename to retrieve.
param: integer $offset     The offset of the part. (The new offset will
param: integer $length     The length of the part. If the length = -1,
param: integer $remaining  The bytes that are left, after the part that
return: string The file data.

write($path, $name, $tmpFile, $autocreate = true)   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.

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 filename to use.
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.

writeData($path, $name, $data, $autocreate = true)   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.

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.

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.

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

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

isFolder($path, $name)   X-Ref
Check if a given pathname is a folder.

param: string $path  The path to the folder.
param: string $name  The file/folder name.
return: boolean  True if it is a folder, false otherwise.

changePermissions($path, $name, $permission)   X-Ref
Changes permissions for an item in the VFS.

param: string $path         The path of directory of the item.
param: string $name         The name of the item.
param: integer $permission  The octal value of the new permission.
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 path of the directory.
param: mixed $filter      String/hash to filter file/dirname on.
param: boolean $dotfiles  Show dotfiles?
param: boolean $dironly   Show only directories?
return: array  File list on success, PEAR_Error on error.

listFolders($path = '', $filter = null, $dotfolders = true)   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        Hash of items to filter based on folderlist.
param: boolean $dotfolders  Include dotfolders?
return: mixed  Folder list on success or a PEAR_Error object on failure.

_getUnixPerms($perms)   X-Ref
Return Unix style perms.

param: integer $perms  The permissions to set.
return: string  Unix style perms.

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.

_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.

_connect()   X-Ref
Stub to check if we have a valid connection. Makes sure that
the vfsroot is readable.

return: mixed  True if vfsroot is readable, PEAR_Error if it isn't.



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