PHP Класс Horde_Vfs_Sql, horde

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-2016 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.
Автор: Chuck Hagenbuch ([email protected])
Автор: Jan Schneider ([email protected])
Наследование: extends Horde_Vfs_Base
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_db Horde_Db Handle for the current database connection.
$_features array List of features that the VFS driver supports.
$_permissions array List of permissions and if they can be changed in this VFS backend.

Открытые методы

Метод Описание
__construct ( array $params = [] ) Constructor.
createFolder ( string $path, string $name ) Creates a folder on the VFS.
deleteFile ( string $path, string $name ) Delete a file from the VFS.
deleteFolder ( string $path, string $name, boolean $recursive = false ) Delete a folder from the VFS.
gc ( string $path, integer $secs = 345600 ) Garbage collect files in the VFS storage system.
getFolderSize ( string $path = null ) : integer Returns the size of a folder.
isFolder ( string $path, string $name ) : boolean Horde_Vfs_Sql override of isFolder() to check for root folder.
read ( string $path, string $name ) : string Retrieves a file from the VFS.
readByteRange ( string $path, string $name, integer &$offset, integer $length, integer &$remaining ) : 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.
rename ( string $oldpath, string $oldname, string $newpath, string $newname ) Rename a file or folder in the VFS.
size ( string $path, string $name ) : integer Retrieves the filesize from the VFS.
write ( string $path, string $name, string $tmpFile, boolean $autocreate = false ) Stores a file in the VFS.
writeData ( string $path, string $name, string $data, boolean $autocreate = false ) Store a file in the VFS from raw data.

Защищенные методы

Метод Описание
_convertPath ( string $path ) : string Converts the path name from regular filesystem form to the internal format needed to access the file in the database.
_getFileSizeOp ( ) : string TODO
_getNativePath ( string $path, string $name ) : string Return a full filename on the native filesystem, from a VFS path and name.
_insertBlob ( string $table, string $field, string $data, string $attributes ) : mixed TODO
_listFolder ( string $path, string | array $filter = null, boolean $dotfiles = true, boolean $dironly = false ) : array Returns an an unsorted file list of the specified directory.
_nullString ( string $value ) : array Returns a comparison for a possibly empty string.
_readBlob ( string $table, string $field, array $criteria ) : mixed Read file data from the SQL VFS backend.
_recursiveRename ( $oldpath, $oldname, $newpath, $newname ) Renames all child paths.
_updateBlob ( string $table, string $field, string $data, string $where, array $alsoupdate ) : mixed TODO

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( array $params = [] )
$params array A hash containing connection parameters.

_convertPath() защищенный Метод

Namely, we will treat '/' as a base directory as this is pretty much the standard way to access base directories over most filesystems.
protected _convertPath ( string $path ) : string
$path string A VFS path.
Результат string The path with any surrouding slashes stripped off.

_getFileSizeOp() защищенный Метод

TODO
protected _getFileSizeOp ( ) : string
Результат string TODO

_getNativePath() защищенный Метод

Return a full filename on the native filesystem, from a VFS path and name.
protected _getNativePath ( string $path, string $name ) : string
$path string The VFS file path.
$name string The VFS filename.
Результат string The full native filename.

_insertBlob() защищенный Метод

TODO
protected _insertBlob ( string $table, string $field, string $data, string $attributes ) : mixed
$table string TODO
$field string TODO
$data string TODO
$attributes string TODO
Результат mixed TODO

_listFolder() защищенный Метод

Returns an an unsorted file list of the specified directory.
protected _listFolder ( string $path, string | array $filter = null, boolean $dotfiles = true, boolean $dironly = false ) : array
$path string The path of the directory.
$filter string | array Regular expression(s) to filter file/directory name on.
$dotfiles boolean Show dotfiles?
$dironly boolean Show only directories?
Результат array File list.

_nullString() защищенный Метод

Returns IS NULL instead of an equals operator if the string is empty.
protected _nullString ( string $value ) : array
$value string A string.
Результат array

_readBlob() защищенный Метод

Read file data from the SQL VFS backend.
protected _readBlob ( string $table, string $field, array $criteria ) : mixed
$table string The VFS table name.
$field string TODO
$criteria array TODO
Результат mixed TODO

_recursiveRename() защищенный Метод

Renames all child paths.
protected _recursiveRename ( $oldpath, $oldname, $newpath, $newname )

_updateBlob() защищенный Метод

TODO
protected _updateBlob ( string $table, string $field, string $data, string $where, array $alsoupdate ) : mixed
$table string TODO
$field string TODO
$data string TODO
$where string TODO
$alsoupdate array TODO
Результат mixed TODO

createFolder() публичный Метод

Creates a folder on the VFS.
public createFolder ( string $path, string $name )
$path string Holds the path of directory to create folder.
$name string Holds the name of the new folder.

deleteFile() публичный Метод

Delete a file from the VFS.
public deleteFile ( string $path, string $name )
$path string The path to store the file in.
$name string The filename to use.

deleteFolder() публичный Метод

Delete a folder from the VFS.
public deleteFolder ( string $path, string $name, boolean $recursive = false )
$path string The path of the folder.
$name string The folder name to use.
$recursive boolean Force a recursive delete?

gc() публичный Метод

Garbage collect files in the VFS storage system.
public gc ( string $path, integer $secs = 345600 )
$path string The VFS path to clean.
$secs integer The minimum amount of time (in seconds) required before a file is removed.

getFolderSize() публичный Метод

Returns the size of a folder.
public getFolderSize ( string $path = null ) : integer
$path string The path of the folder.
Результат integer The size of the folder in bytes.

isFolder() публичный Метод

Horde_Vfs_Sql override of isFolder() to check for root folder.
public isFolder ( string $path, string $name ) : boolean
$path string Path to possible folder
$name string Name of possible folder
Результат boolean True if $path/$name is a folder

read() публичный Метод

Retrieves a file from the VFS.
public read ( string $path, string $name ) : string
$path string The pathname to the file.
$name string The filename to retrieve.
Результат string The file data.

readByteRange() публичный Метод

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.
public readByteRange ( string $path, string $name, integer &$offset, integer $length, integer &$remaining ) : string
$path string The pathname to the file.
$name string The filename to retrieve.
$offset integer The offset of the part. (The new offset will be stored in here).
$length integer 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.
$remaining integer The bytes that are left, after the part that is retrieved.
Результат string The file data.

rename() публичный Метод

Rename a file or folder in the VFS.
public rename ( string $oldpath, string $oldname, string $newpath, string $newname )
$oldpath string The old path to the file.
$oldname string The old filename.
$newpath string The new path of the file.
$newname string The new filename.

size() публичный Метод

Retrieves the filesize from the VFS.
public size ( string $path, string $name ) : integer
$path string The pathname to the file.
$name string The filename to retrieve.
Результат integer The file size.

write() публичный Метод

Stores a file in the VFS.
public write ( string $path, string $name, string $tmpFile, boolean $autocreate = false )
$path string The path to store the file in.
$name string The filename to use.
$tmpFile string The temporary file containing the data to be stored.
$autocreate boolean Automatically create directories?

writeData() публичный Метод

Store a file in the VFS from raw data.
public writeData ( string $path, string $name, string $data, boolean $autocreate = false )
$path string The path to store the file in.
$name string The filename to use.
$data string The file data.
$autocreate boolean Automatically create directories?

Описание свойств

$_db защищенное свойство

Handle for the current database connection.
protected Horde_Db $_db
Результат Horde_Db

$_features защищенное свойство

List of features that the VFS driver supports.
protected array $_features
Результат array

$_permissions защищенное свойство

List of permissions and if they can be changed in this VFS backend.
protected array $_permissions
Результат array