Overview

Packages

  • Vfs

Classes

  • Horde_Vfs
  • Horde_Vfs_Base
  • Horde_Vfs_Browser
  • Horde_Vfs_Exception
  • Horde_Vfs_File
  • Horde_Vfs_Ftp
  • Horde_Vfs_Gc
  • Horde_Vfs_Horde
  • Horde_Vfs_Kolab
  • Horde_Vfs_ListItem
  • Horde_Vfs_Musql
  • Horde_Vfs_Object
  • Horde_Vfs_Smb
  • Horde_Vfs_Sql
  • Horde_Vfs_SqlFile
  • Horde_Vfs_Ssh2
  • Horde_Vfs_Translation
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Vfs_Sql

VFS implementation for Horde's database abstraction layer.

Required values for $params: - db: A Horde_Db_Adapter object.

Optional values: - table: (string) The name of the vfs table in 'database'. Defaults to 'horde_vfs'.

The table structure for the VFS can be created with the horde-db-migrate script from the Horde_Db package.

Copyright 2002-2012 Horde LLC (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.

Horde_Vfs_Base
Extended by Horde_Vfs_Sql

Direct known subclasses

Horde_Vfs_Musql
Package: Vfs
Category: Horde
License: LGPL 2.1
Author: Chuck Hagenbuch chuck@horde.org
Author: Jan Schneider jan@horde.org
Located at Horde/Vfs/Sql.php
Methods summary
public
# __construct( array $params = array() )

Constructor.

Constructor.

Parameters

$params
A hash containing connection parameters.

Overrides

Horde_Vfs_Base::__construct()
public integer
# size( string $path, string $name )

Retrieves the filesize from the VFS.

Retrieves the filesize from the VFS.

Parameters

$path
The pathname to the file.
$name
The filename to retrieve.

Returns

integer
The file size.

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::size()
public integer
# getFolderSize( string $path = null, string $name = null )

Returns the size of a file.

Returns the size of a file.

Parameters

$path
The path of the file.
$name
The filename.

Returns

integer
The size of the folder in bytes.

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::getFolderSize()
public string
# read( string $path, string $name )

Retrieves a file from the VFS.

Retrieves a file from the VFS.

Parameters

$path
The pathname to the file.
$name
The filename to retrieve.

Returns

string
The file data.

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::read()
public string
# readByteRange( string $path, string $name, integer & $offset, integer $length, integer & $remaining )

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.

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.

Parameters

$path
The pathname to the file.
$name
The filename to retrieve.
$offset
<p>The offset of the part. (The new offset will be stored in here).</p>
$length
<p>The length of the part. If the length = -1, the whole part after the offset is retrieved. If more bytes are given as exists after the given offset. Only the available bytes are read.</p>
$remaining
<p>The bytes that are left, after the part that is retrieved.</p>

Returns

string
The file data.

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::readByteRange()
public
# write( string $path, string $name, string $tmpFile, boolean $autocreate = false )

Stores a file in the VFS.

Stores a file in the VFS.

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

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::write()
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

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::writeData()
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

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::deleteFile()
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

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::rename()
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

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::createFolder()
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 of the folder.
$name
The folder name to use.
$recursive
Force a recursive delete?

Throws

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::deleteFolder()
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

Horde_Vfs_Exception

Overrides

Horde_Vfs_Base::listFolders()
public
# gc( string $path, integer $secs = 345600 )

Garbage collect files in the VFS storage system.

Garbage collect files in the VFS storage system.

Parameters

$path
The VFS path to clean.
$secs
<p>The minimum amount of time (in seconds) required before a file is removed.</p>

Throws

Horde_Vfs_Exception
public boolean
# isFolder( string $path, string $name )

Horde_Vfs_Sql override of isFolder() to check for root folder.

Horde_Vfs_Sql override of isFolder() to check for root folder.

Parameters

$path
Path to possible folder
$name
Name of possible folder

Returns

boolean
True if $path/$name is a folder

Overrides

Horde_Vfs_Base::isFolder()
Methods inherited from Horde_Vfs_Base
autocreatePath(), changePermissions(), checkCredentials(), copy(), delete(), emptyFolder(), exists(), getCurrentDirectory(), getModifiablePermissions(), getParam(), getQuota(), getRequiredCredentials(), getVFSSize(), listFolder(), move(), readFile(), setParams(), setQuota(), setQuotaRoot()
Constants summary
integer FILE
# 1
integer FOLDER
# 2
API documentation generated by ApiGen