PHP Class 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.
Author: Max Kalika ([email protected])
Author: Chuck Hagenbuch ([email protected])
Author: Michael Slusarz ([email protected])
Afficher le fichier Open project: horde/horde Class Usage Examples

Méthodes publiques

Свойство Type Description
$backend array Configuration hash for the current backend.

Protected Properties

Свойство Type Description
$_columns array Cache for display columns.

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
_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.

Method Details

_copyFile() protected static méthode

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

_getCacheID() protected static méthode

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

_setLabel() protected static méthode

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

_sortDirs() protected static méthode

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

changeDir() public static méthode

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

changePermissions() public static méthode

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() public static méthode

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.
Résultat boolean Returns true if the user has permission.

copyFile() public static méthode

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() public static méthode

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() public static méthode

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() public static méthode

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() public static méthode

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

getColumns() public static méthode

Parses the 'columns' preference.
public static getColumns ( $backend ) : array
Résultat array The list of columns to be displayed.

getDisplayPath() public static méthode

Generate the display path (the path with any root information stripped out).
public static getDisplayPath ( string $path ) : string
$path string The path to display.
Résultat string The display path.

getVFSPath() public static méthode

This pair is used for the input to many VFS library functions.
public static getVFSPath ( string $fullpath ) : array
$fullpath string Path to be split.
Résultat array Array of ($path, $name)

listFolder() public static méthode

List the current folder.
public static listFolder ( string $dir ) : array
$dir string The directory name.
Résultat array The sorted list of files.

moveFile() public static méthode

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() public static méthode

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.
Résultat string URL-encoded string with '/' preserved.

renameItem() public static méthode

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() public static méthode

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

sortDate() public static méthode

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

sortName() public static méthode

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

sortSize() public static méthode

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

sortType() public static méthode

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

stripAPIPath() public static méthode

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.
Résultat string Cleaned path as described above.

subdirectory() public static méthode

Generate correct subdirectory links.
public static subdirectory ( string $base, string $dir ) : string
$base string The base directory.
$dir string The directory string.
Résultat string The correct subdirectoy string.

verifyDir() public static méthode

This function verifies whether a given directory is below the root.
public static verifyDir ( string $dir ) : boolean
$dir string The directory to check.
Résultat boolean True if the directory is below the root.

writeFile() public static méthode

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.

Property Details

$_columns protected_oe static_oe property

Cache for display columns.
protected static array $_columns
Résultat array

$backend public_oe static_oe property

Configuration hash for the current backend.
public static array $backend
Résultat array