Horde_Vfs:: implementation using PHP's PEAR database abstraction
layer and local file system for file storage.
Required values for $params:
db - (DB) The DB object.
vfsroot - (string) The root directory of where the files should be
actually stored.
Optional values:
table - (string) The name of the vfs table in 'database'. Defaults to
'horde_vfs'.
The table structure for the VFS can be found in data/vfs.sql.
Methods summary
public
|
#
__construct( array $params = array() )
Constructor.
Parameters
- $params
- A hash containing connection parameters.
Overrides
|
public
|
#
write( string $path, string $name, string $tmpFile, boolean $autocreate = false )
Store a file in the VFS, with the data copied from a temporary
file.
Store a file in the VFS, with the data copied from a temporary
file.
Parameters
- $path
- The path to store the file in.
- $name
- The filename to use.
- $tmpFile
- <p>The temporary file containing the data to be
stored.</p>
- $autocreate
- Automatically create directories?
Throws
Overrides
|
public
|
#
writeData( string $path, string $name, string $data, boolean $autocreate = false )
Store a file in the VFS from raw data.
Store a file in the VFS from raw data.
Parameters
- $path
- The path to store the file in.
- $name
- The filename to use.
- $data
- The file data.
- $autocreate
- Automatically create directories?
Throws
Overrides
|
public
|
#
move( string $path, string $name, string $dest, boolean $autocreate = false )
Moves a file in the database and the file system.
Moves a file in the database and the file system.
Parameters
- $path
- The path to store the file in.
- $name
- The old filename.
- $dest
- The new filename.
- $autocreate
- Automatically create directories?
Throws
Overrides
|
public
|
#
copy( string $path, string $name, string $dest, boolean $autocreate = false )
Copies a file through the backend.
Copies a file through the backend.
Parameters
- $path
- The path to store the file in.
- $name
- The filename to use.
- $dest
- The destination of the file.
- $autocreate
- Automatically create directories?
Throws
Overrides
|
public
|
#
createFolder( string $path, string $name )
Creates a folder on the VFS.
Creates a folder on the VFS.
Parameters
- $path
- Holds the path of directory to create folder.
- $name
- Holds the name of the new folder.
Throws
Overrides
|
public
|
#
rename( string $oldpath, string $oldname, string $newpath, string $newname )
Rename a file or folder in the VFS.
Rename a file or folder in the VFS.
Parameters
- $oldpath
- The old path to the file.
- $oldname
- The old filename.
- $newpath
- The new path of the file.
- $newname
- The new filename.
Throws
Overrides
|
public
|
#
deleteFolder( string $path, string $name, boolean $recursive = false )
Delete a folder from the VFS.
Delete a folder from the VFS.
Parameters
- $path
- The path to delete the folder from.
- $name
- The foldername to use.
- $recursive
- Force a recursive delete?
Throws
Overrides
|
public
|
#
deleteFile( string $path, string $name )
Delete a file from the VFS.
Delete a file from the VFS.
Parameters
- $path
- The path to store the file in.
- $name
- The filename to use.
Throws
Overrides
|
public
array
|
#
listFolders( string $path = '', mixed $filter = array(), boolean $dotfolders = true )
Returns a sorted list of folders in specified directory.
Returns a sorted list of folders in specified directory.
Parameters
- $path
- <p>The path of the directory to get the
directory list for.</p>
- $filter
- <p>String/hash of items to filter based on
folderlist.</p>
- $dotfolders
- Include dotfolders?
Returns
array Folder list.
Throws
Overrides
|