PHP Класс Gollem, horde

Copyright 1999-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Автор: Max Kalika ([email protected])
Автор: Chuck Hagenbuch ([email protected])
Автор: Michael Slusarz ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$backend array Configuration hash for the current backend.

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

Свойство Тип Описание
$_columns array Cache for display columns.

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

Метод Описание
changeDir ( ) Changes the current directory of the Gollem session based on the 'dir' form field.
changePermissions ( string $dir, string $name, string $permission ) Change permissions on files using the current Gollem session settings.
checkPermissions ( string $filter, integer $permission = Horde_Perms::READ, string $resource = null ) : boolean Checks if a user has the specified permissions on a resource.
copyFile ( string $backend_f, string $dir, string $name, string $backend_t, string $newdir ) Copies a file using the current Gollem session settings.
createFolder ( string $dir, string $name, Horde_Vfs_Base $gollem_vfs = null ) Create a folder using the current Gollem session settings.
deleteFile ( string $dir, string $name ) Delete a file using the current Gollem session settings.
deleteFolder ( string $dir, string $name ) Delete a folder using the current Gollem session settings.
directoryNavLink ( string $currdir, string $url ) : string Produces a directory link used for navigation.
expireCache ( string $dir ) Expire a folder cache entry.
getColumns ( $backend ) : array Parses the 'columns' preference.
getDisplayPath ( string $path ) : string Generate the display path (the path with any root information stripped out).
getVFSPath ( string $fullpath ) : array Take a fully qualified and break off the file or directory name.
listFolder ( string $dir ) : array List the current folder.
moveFile ( string $backend_f, string $dir, string $name, string $backend_t, string $newdir ) Moves a file using the current Gollem session settings.
pathEncode ( string $path ) : string Convert a Gollem path into a URL encoded string, but keep '/'.
renameItem ( string $oldDir, string $old, string $newDir, $new ) Rename files using the current Gollem session settings.
setDir ( string $dir ) Changes the current directory of the Gollem session to the supplied value.
sortDate ( $a, $b ) Internal sorting function for 'date'.
sortName ( $a, $b ) Internal sorting function for 'name'.
sortSize ( $a, $b ) Internal sorting function for 'size'.
sortType ( $a, $b ) Internal sorting function for 'type'.
stripAPIPath ( string $path ) : string Cleans a path presented to Gollem's browse API call.
subdirectory ( string $base, string $dir ) : string Generate correct subdirectory links.
verifyDir ( string $dir ) : boolean This function verifies whether a given directory is below the root.
writeFile ( string $dir, string $name, string $filename ) Write an uploaded file to the VFS backend.

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

Метод Описание
_copyFile ( $mode, $backend_f, $dir, $name, $backend_t, $newdir ) Private function that copies/moves files.
_getCacheID ( string $dir ) Generate the Cache ID for a directory.
_setLabel ( ) Set the lable to use for the current page.
_sortDirs ( $a, $b ) Internal helper to sort directories first if pref set.

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

_copyFile() защищенный статический Метод

Private function that copies/moves files.
protected static _copyFile ( $mode, $backend_f, $dir, $name, $backend_t, $newdir )

_getCacheID() защищенный статический Метод

Generate the Cache ID for a directory.
protected static _getCacheID ( string $dir )
$dir string The directory name.

_setLabel() защищенный статический Метод

Set the lable to use for the current page.
protected static _setLabel ( )

_sortDirs() защищенный статический Метод

Internal helper to sort directories first if pref set.
protected static _sortDirs ( $a, $b )

changeDir() публичный статический Метод

Changes the current directory of the Gollem session based on the 'dir' form field.
public static changeDir ( )

changePermissions() публичный статический Метод

Change permissions on files using the current Gollem session settings.
public static changePermissions ( string $dir, string $name, string $permission )
$dir string The directory name.
$name string The filename to change permissions on.
$permission string The permission mode to set.

checkPermissions() публичный статический Метод

Checks if a user has the specified permissions on a resource.
public static checkPermissions ( string $filter, integer $permission = Horde_Perms::READ, string $resource = null ) : boolean
$filter string What are we checking for. Either 'backend' or 'directory'.
$permission integer The permission to check for. One of the Horde_Perms constants.
$resource string The resource to check. If empty, check the current backend/directory.
Результат boolean Returns true if the user has permission.

copyFile() публичный статический Метод

Copies a file using the current Gollem session settings.
public static copyFile ( string $backend_f, string $dir, string $name, string $backend_t, string $newdir )
$backend_f string The backend to copy the file from.
$dir string The directory name of the original file.
$name string The original filename.
$backend_t string The backend to copy the file to.
$newdir string The directory to copy the file to.

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

Create a folder using the current Gollem session settings.
public static createFolder ( string $dir, string $name, Horde_Vfs_Base $gollem_vfs = null )
$dir string The directory path.
$name string The folder to create.
$gollem_vfs Horde_Vfs_Base A VFS instance to use.

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

Delete a file using the current Gollem session settings.
public static deleteFile ( string $dir, string $name )
$dir string The directory name.
$name string The filename to delete.

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

Delete a folder using the current Gollem session settings.
public static deleteFolder ( string $dir, string $name )
$dir string The subdirectory name.
$name string The folder name to delete.

expireCache() публичный статический Метод

Expire a folder cache entry.
public static expireCache ( string $dir )
$dir string The directory name.

getColumns() публичный статический Метод

Parses the 'columns' preference.
public static getColumns ( $backend ) : array
Результат array The list of columns to be displayed.

getDisplayPath() публичный статический Метод

Generate the display path (the path with any root information stripped out).
public static getDisplayPath ( string $path ) : string
$path string The path to display.
Результат string The display path.

getVFSPath() публичный статический Метод

This pair is used for the input to many VFS library functions.
public static getVFSPath ( string $fullpath ) : array
$fullpath string Path to be split.
Результат array Array of ($path, $name)

listFolder() публичный статический Метод

List the current folder.
public static listFolder ( string $dir ) : array
$dir string The directory name.
Результат array The sorted list of files.

moveFile() публичный статический Метод

Moves a file using the current Gollem session settings.
public static moveFile ( string $backend_f, string $dir, string $name, string $backend_t, string $newdir )
$backend_f string The backend to move the file from.
$dir string The directory name of the original file.
$name string The original filename.
$backend_t string The backend to move the file to.
$newdir string The directory to move the file to.

pathEncode() публичный статический Метод

This allows for proper PATH_INFO path parsing. Special care is taken to handle "+" and " ".
public static pathEncode ( string $path ) : string
$path string Path to be urlencode()d.
Результат string URL-encoded string with '/' preserved.

renameItem() публичный статический Метод

Rename files using the current Gollem session settings.
public static renameItem ( string $oldDir, string $old, string $newDir, $new )
$oldDir string Old directory name.
$old string Old file name.
$newDir string New directory name.

setDir() публичный статический Метод

Changes the current directory of the Gollem session to the supplied value.
public static setDir ( string $dir )
$dir string Directory name.

sortDate() публичный статический Метод

Internal sorting function for 'date'.
public static sortDate ( $a, $b )

sortName() публичный статический Метод

Internal sorting function for 'name'.
public static sortName ( $a, $b )

sortSize() публичный статический Метод

Internal sorting function for 'size'.
public static sortSize ( $a, $b )

sortType() публичный статический Метод

Internal sorting function for 'type'.
public static sortType ( $a, $b )

stripAPIPath() публичный статический Метод

This will remove: - leading '/' - leading 'gollem' - trailing '/' The desired end result is the path including VFS backend.
public static stripAPIPath ( string $path ) : string
$path string Path as presented to Gollem API.
Результат string Cleaned path as described above.

subdirectory() публичный статический Метод

Generate correct subdirectory links.
public static subdirectory ( string $base, string $dir ) : string
$base string The base directory.
$dir string The directory string.
Результат string The correct subdirectoy string.

verifyDir() публичный статический Метод

This function verifies whether a given directory is below the root.
public static verifyDir ( string $dir ) : boolean
$dir string The directory to check.
Результат boolean True if the directory is below the root.

writeFile() публичный статический Метод

Write an uploaded file to the VFS backend.
public static writeFile ( string $dir, string $name, string $filename )
$dir string The directory name.
$name string The filename to create.
$filename string The local file containing the file data.

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

$_columns защищенное статическое свойство

Cache for display columns.
protected static array $_columns
Результат array

$backend публичное статическое свойство

Configuration hash for the current backend.
public static array $backend
Результат array