PHP 클래스 Horde_Share_Base, horde

Copyright 2002-2016 Horde LLC (http://www.horde.org/) Copyright 2002-2007 Infoteck Internet See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
저자: Joel Vandal ([email protected])
저자: Mike Cochrame ([email protected])
저자: Chuck Hagenbuch ([email protected])
저자: Jan Schneider ([email protected])
저자: Gunnar Wrobel ([email protected])
저자: Michael J. Rubinsky ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_app string The application we're managing shares for.
$_cache array A cache of all shares that have been retrieved, so we don't hit the backend again and again for them.
$_callbacks array modify - Called immediately before a share object's changes are saved to storage. Receives the share object as a parameter. remove - Called immediately before a share is removed from storage. Receives the share object as a parameter. list - Called immediately after a list of shares is received from storage. Passed the userid, share list, and any parameters passed to the listShare call. Should return the (possibly modified) share list. @see listShares() for more info.
$_groups Horde_Group_Base The Horde_Group driver
$_listcache array Cache used for listShares().
$_logger Horde_Log_Logger Logger
$_permsObject Horde_Perms_Base The Horde_Perms object
$_root mixed The root of the Share tree.
$_shareCallback callback A callback that is passed to the share objects for setting the objects' Horde_Share object.
$_shareMap array Id-name-map of already cached share objects.
$_shareObject string The Horde_Share_Object subclass to instantiate objects as
$_sortList array A list of objects that we're currently sorting, for reference during the sorting algorithm.
$_user string The current user

공개 메소드들

메소드 설명
__construct ( string $app, string $user, Horde_Perms_Base $perms, Horde_Group_Base $groups ) Constructor.
addCallback ( string $type, array $callback ) Add a callback to the collection
addShare ( Horde_Share_Object $share ) Adds a share to the shares system.
countShares ( string $userid, integer $perm = Horde_Perms::SHOW, mixed $attributes = null ) : integer Returns the number of shares that $userid has access to.
exists ( string $share ) : boolean Checks if a share name exists in the system.
expireListCache ( ) Expire the current list cache. This would be needed anytime a share is either added, deleted, had a change in owner, parent, or perms.
getApp ( ) : string Returns the application we're managing shares for.
getListCache ( ) : array Returns the share's list cache.
getPermissions ( mixed $share, string $user = null ) : mixed Finds out what rights the given user has to this object.
getPermsObject ( ) : Horde_Perms_Base Getter for Horde_Perms object
getShare ( string $name ) : Horde_Share_Object Returns a Horde_Share_Object object corresponding to the given share name, with the details retrieved appropriately.
getShareById ( string $cid ) : Horde_Share_Object Returns a Horde_Share_Object object corresponding to the given unique ID, with the details retrieved appropriately.
getShares ( array $cids ) : array Returns an array of Horde_Share_Object objects corresponding to the given set of unique IDs, with the details retrieved appropriately.
idExists ( integer $id ) : boolean Check that a share id exists in the system.
initShareObject ( Horde_Share_Object $object ) (Re)connects the share object to this share driver.
listAllShares ( ) : array Lists *all* shares for the current app/share, regardless of permissions.
listShares ( string $userid, array $params = [] ) : array Returns an array of all shares that $userid has access to.
listSystemShares ( ) : array Returns an array of all system shares.
newShare ( string $owner, string $share_name = '', string $name_attribute = '' ) : Horde_Share_Object Returns a new share object.
removeShare ( Horde_Share_Object $share ) Removes a share from the shares system permanently.
renameShare ( Horde_Share_Object $share, string $name ) Renames a share in the shares system.
resetCache ( ) Resets the internal caches.
runCallback ( string $type, array $params ) : mixed Give public access to call the share callbacks. Needed to run the callbacks from the Horde_Share_Object objects.
setListCache ( array $cache ) Set the list cache.
setLogger ( Horde_Log_Logger $logger ) Set a logger object.
setShareCallback ( $callback )
setShareClass ( $classname ) Set the class type to use for creating share objects.
toDriverCharset ( array $data ) Convert TO the storage driver's charset. Individual share objects should implement this method if needed.

보호된 메소드들

메소드 설명
_addShare ( Horde_Share_Object $share ) Adds a share to the shares system.
_exists ( string $share ) : boolean Checks if a share exists in the system.
_getShare ( string $name ) : Horde_Share_Object Returns a Horde_Share_Object object corresponding to the given share name, with the details retrieved appropriately.
_getShareById ( integer $id ) : Horde_Share_Object_sql Returns a Horde_Share_Object object corresponding to the given unique ID, with the details retrieved appropriately.
_getShares ( array $ids ) : array Returns an array of Horde_Share_Object objects corresponding to the given set of unique IDs, with the details retrieved appropriately.
_idExists ( integer $id ) : boolean Check that a share id exists in the system.
_listAllShares ( ) : array Lists *all* shares for the current app/share, regardless of permissions.
_listShares ( string $userid, array $params = [] ) : array Returns an array of all shares that $userid has access to.
_newShare ( string $name ) : Horde_Share_Object Returns a new share object.
_removeShare ( Horde_Share_Object $share ) Removes a share from the shares system permanently.
_renameShare ( Horde_Share_Object $share, string $name ) Renames a share in the shares system.
_sortShares ( $a, $b ) Utility function to be used with uasort() for sorting arrays of Horde_Share objects.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( string $app, string $user, Horde_Perms_Base $perms, Horde_Group_Base $groups )
$app string The application that the shares belong to.
$user string The current user.
$perms Horde_Perms_Base The permissions object.
$groups Horde_Group_Base The Horde_Group driver.

_addShare() 추상적인 보호된 메소드

The share must first be created with Horde_Share_sql::_newShare(), and have any initial details added to it, before this function is called.
abstract protected _addShare ( Horde_Share_Object $share )
$share Horde_Share_Object The new share object.

_exists() 추상적인 보호된 메소드

Checks if a share exists in the system.
abstract protected _exists ( string $share ) : boolean
$share string The share to check.
리턴 boolean True if the share exists.

_getShare() 추상적인 보호된 메소드

Returns a Horde_Share_Object object corresponding to the given share name, with the details retrieved appropriately.
abstract protected _getShare ( string $name ) : Horde_Share_Object
$name string The name of the share to retrieve.
리턴 Horde_Share_Object The requested share.

_getShareById() 추상적인 보호된 메소드

Returns a Horde_Share_Object object corresponding to the given unique ID, with the details retrieved appropriately.
abstract protected _getShareById ( integer $id ) : Horde_Share_Object_sql
$id integer The id of the share to retrieve.
리턴 Horde_Share_Object_sql The requested share.

_getShares() 추상적인 보호된 메소드

Returns an array of Horde_Share_Object objects corresponding to the given set of unique IDs, with the details retrieved appropriately.
abstract protected _getShares ( array $ids ) : array
$ids array The array of ids to retrieve.
리턴 array The requested shares.

_idExists() 추상적인 보호된 메소드

Check that a share id exists in the system.
abstract protected _idExists ( integer $id ) : boolean
$id integer The share id
리턴 boolean True if the share exists.

_listAllShares() 추상적인 보호된 메소드

Lists *all* shares for the current app/share, regardless of permissions.
abstract protected _listAllShares ( ) : array
리턴 array All shares for the current app/share.

_listShares() 추상적인 보호된 메소드

Returns an array of all shares that $userid has access to.
abstract protected _listShares ( string $userid, array $params = [] ) : array
$userid string The userid of the user to check access for.
$params array See listShares().
리턴 array The shares the user has access to.

_newShare() 추상적인 보호된 메소드

Returns a new share object.
abstract protected _newShare ( string $name ) : Horde_Share_Object
$name string The share's name.
리턴 Horde_Share_Object A new share object

_removeShare() 추상적인 보호된 메소드

Removes a share from the shares system permanently.
abstract protected _removeShare ( Horde_Share_Object $share )
$share Horde_Share_Object The share to remove.

_renameShare() 추상적인 보호된 메소드

Renames a share in the shares system.
abstract protected _renameShare ( Horde_Share_Object $share, string $name )
$share Horde_Share_Object The share to rename.
$name string The share's new name.

_sortShares() 보호된 메소드

Example: uasort($list, array('Horde_Share', '_sortShares'));
protected _sortShares ( $a, $b )

addCallback() 공개 메소드

Add a callback to the collection
public addCallback ( string $type, array $callback )
$type string
$callback array

addShare() 공개 메소드

The share must first be created with newShare(), and have any initial details added to it, before this function is called.
public addShare ( Horde_Share_Object $share )
$share Horde_Share_Object The new share object.

countShares() 공개 메소드

Returns the number of shares that $userid has access to.
public countShares ( string $userid, integer $perm = Horde_Perms::SHOW, mixed $attributes = null ) : integer
$userid string The userid of the user to check access for.
$perm integer The level of permissions required.
$attributes mixed Restrict the shares counted to those matching $attributes. An array of attribute/values pairs or a share owner username.
리턴 integer The number of shares

exists() 공개 메소드

Checks if a share name exists in the system.
public exists ( string $share ) : boolean
$share string The share name to check.
리턴 boolean True if the share exists.

expireListCache() 공개 메소드

Expire the current list cache. This would be needed anytime a share is either added, deleted, had a change in owner, parent, or perms.
public expireListCache ( )

getApp() 공개 메소드

Returns the application we're managing shares for.
public getApp ( ) : string
리턴 string The application this share belongs to.

getListCache() 공개 메소드

Returns the share's list cache.
public getListCache ( ) : array
리턴 array

getPermissions() 공개 메소드

Finds out what rights the given user has to this object.
또한 보기: Horde_Perms::getPermissions
public getPermissions ( mixed $share, string $user = null ) : mixed
$share mixed The share that should be checked for the users permissions.
$user string The user to check for.
리턴 mixed A bitmask of permissions, a permission value, or an array of permission values the user has, depending on the permission type and whether the permission value is ambiguous. False if there is no such permsission.

getPermsObject() 공개 메소드

Getter for Horde_Perms object
public getPermsObject ( ) : Horde_Perms_Base
리턴 Horde_Perms_Base

getShare() 공개 메소드

Returns a Horde_Share_Object object corresponding to the given share name, with the details retrieved appropriately.
public getShare ( string $name ) : Horde_Share_Object
$name string The name of the share to retrieve.
리턴 Horde_Share_Object The requested share.

getShareById() 공개 메소드

Returns a Horde_Share_Object object corresponding to the given unique ID, with the details retrieved appropriately.
public getShareById ( string $cid ) : Horde_Share_Object
$cid string The id of the share to retrieve.
리턴 Horde_Share_Object The requested share.

getShares() 공개 메소드

Returns an array of Horde_Share_Object objects corresponding to the given set of unique IDs, with the details retrieved appropriately.
public getShares ( array $cids ) : array
$cids array The array of ids to retrieve.
리턴 array The requested shares.

idExists() 공개 메소드

Check that a share id exists in the system.
public idExists ( integer $id ) : boolean
$id integer The share id
리턴 boolean True if the share exists.

initShareObject() 공개 메소드

(Re)connects the share object to this share driver.
public initShareObject ( Horde_Share_Object $object )
$object Horde_Share_Object

listAllShares() 공개 메소드

This is for admin functionality and scripting tools, and shouldn't be called from user-level code!
public listAllShares ( ) : array
리턴 array All shares for the current app/share.

listShares() 공개 메소드

Returns an array of all shares that $userid has access to.
public listShares ( string $userid, array $params = [] ) : array
$userid string The userid of the user to check access for. An empty value for the userid will only return shares with guest access.
$params array Additional parameters for the search.
 'perm'        Require this level of permissions. Horde_Perms constant.
 'attributes'  Restrict shares to these attributes. A hash or username.
 'from'        Offset. Start at this share
 'count'       Limit.  Only return this many.
 'sort_by'     Sort by attribute.
 'direction'   Sort by direction.
리턴 array The shares the user has access to.

listSystemShares() 공개 메소드

Returns an array of all system shares.
public listSystemShares ( ) : array
리턴 array All system shares.

newShare() 공개 메소드

Returns a new share object.
public newShare ( string $owner, string $share_name = '', string $name_attribute = '' ) : Horde_Share_Object
$owner string The share owner name.
$share_name string The share's name.
$name_attribute string The name displayed to the user.
리턴 Horde_Share_Object A new share object.

removeShare() 공개 메소드

Removes a share from the shares system permanently.
public removeShare ( Horde_Share_Object $share )
$share Horde_Share_Object The share to remove.

renameShare() 공개 메소드

Renames a share in the shares system.
public renameShare ( Horde_Share_Object $share, string $name )
$share Horde_Share_Object The share to rename.
$name string The share's new name.

resetCache() 공개 메소드

Resets the internal caches.
public resetCache ( )

runCallback() 공개 메소드

Give public access to call the share callbacks. Needed to run the callbacks from the Horde_Share_Object objects.
public runCallback ( string $type, array $params ) : mixed
$type string The callback to run
$params array The parameters to pass to the callback.
리턴 mixed

setListCache() 공개 메소드

Set the list cache.
public setListCache ( array $cache )
$cache array

setLogger() 공개 메소드

Set a logger object.
public setLogger ( Horde_Log_Logger $logger )
$logger Horde_Log_Logger

setShareCallback() 공개 메소드

public setShareCallback ( $callback )

setShareClass() 공개 메소드

Set the class type to use for creating share objects.
public setShareClass ( $classname )

toDriverCharset() 공개 메소드

Convert TO the storage driver's charset. Individual share objects should implement this method if needed.
public toDriverCharset ( array $data )
$data array Data to be converted.

프로퍼티 상세

$_app 보호되어 있는 프로퍼티

The application we're managing shares for.
protected string $_app
리턴 string

$_cache 보호되어 있는 프로퍼티

A cache of all shares that have been retrieved, so we don't hit the backend again and again for them.
protected array $_cache
리턴 array

$_callbacks 보호되어 있는 프로퍼티

modify - Called immediately before a share object's changes are saved to storage. Receives the share object as a parameter. remove - Called immediately before a share is removed from storage. Receives the share object as a parameter. list - Called immediately after a list of shares is received from storage. Passed the userid, share list, and any parameters passed to the listShare call. Should return the (possibly modified) share list. @see listShares() for more info.
protected array $_callbacks
리턴 array

$_groups 보호되어 있는 프로퍼티

The Horde_Group driver
protected Horde_Group_Base $_groups
리턴 Horde_Group_Base

$_listcache 보호되어 있는 프로퍼티

Cache used for listShares().
protected array $_listcache
리턴 array

$_logger 보호되어 있는 프로퍼티

Logger
protected Horde_Log_Logger $_logger
리턴 Horde_Log_Logger

$_permsObject 보호되어 있는 프로퍼티

The Horde_Perms object
protected Horde_Perms_Base $_permsObject
리턴 Horde_Perms_Base

$_root 보호되어 있는 프로퍼티

The root of the Share tree.
protected mixed $_root
리턴 mixed

$_shareCallback 보호되어 있는 프로퍼티

A callback that is passed to the share objects for setting the objects' Horde_Share object.
protected callback $_shareCallback
리턴 callback

$_shareMap 보호되어 있는 프로퍼티

Id-name-map of already cached share objects.
protected array $_shareMap
리턴 array

$_shareObject 보호되어 있는 프로퍼티

The Horde_Share_Object subclass to instantiate objects as
protected string $_shareObject
리턴 string

$_sortList 보호되어 있는 프로퍼티

A list of objects that we're currently sorting, for reference during the sorting algorithm.
protected array $_sortList
리턴 array

$_user 보호되어 있는 프로퍼티

The current user
protected string $_user
리턴 string