PHP 클래스 Horde_Lock, horde

Copyright 2008-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.
저자: Ben Klang ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_logger Horde_Log_Logger Logger.
$_params array Driver parameters.

공개 메소드들

메소드 설명
__construct ( array $params = [] ) Constructor.
clearLock ( string $lockid ) : boolean Removes a lock given the lock ID.
getLockInfo ( string $lockid ) : array Return an array of information about the requested lock.
getLocks ( string $scope = null, string $principal = null, integer $type = null ) : array Return a list of valid locks with the option to limit the results by principal, scope and/or type.
resetLock ( string $lockid, integer $extend ) : boolean Extend the valid lifetime of a valid lock to now + $extend.
setLock ( string $requestor, string $scope, string $principal, integer $lifetime = 1, $exclusive = Horde_Lock::TYPE_SHARED ) : mixed Sets a lock on the requested principal and returns the generated lock ID. NOTE: No security checks are done in the Horde_Lock API. It is expected that the calling application has done all necessary security checks before requesting a lock be granted.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( array $params = [] )
$params array Configuration parameters:
'logger' - (Horde_Log_Logger) A logger instance.

clearLock() 추상적인 공개 메소드

NOTE: No security checks are done in the Horde_Lock API. It is expected that the calling application has done all necessary security checks before requesting a lock be cleared.
abstract public clearLock ( string $lockid ) : boolean
$lockid string The lock ID as generated by a previous call to setLock()
리턴 boolean Returns true on success.

getLockInfo() 추상적인 공개 메소드

Return an array of information about the requested lock.
abstract public getLockInfo ( string $lockid ) : array
$lockid string Lock ID to look up.
리턴 array Lock information.

getLocks() 추상적인 공개 메소드

Return a list of valid locks with the option to limit the results by principal, scope and/or type.
abstract public getLocks ( string $scope = null, string $principal = null, integer $type = null ) : array
$scope string The scope of the lock. Typically the name of the application requesting the lock or some other identifier used to group locks together.
$principal string Principal for which to check for locks
$type integer Only return locks of the given type. Defaults to null, or all locks
리턴 array Array of locks with the ID as the key and the lock details as the value. If there are no current locks this will return an empty array.

resetLock() 추상적인 공개 메소드

Extend the valid lifetime of a valid lock to now + $extend.
abstract public resetLock ( string $lockid, integer $extend ) : boolean
$lockid string Lock ID to reset. Must be a valid, non-expired lock.
$extend integer Extend lock this many seconds from now.
리턴 boolean Returns true on success.

setLock() 추상적인 공개 메소드

Sets a lock on the requested principal and returns the generated lock ID. NOTE: No security checks are done in the Horde_Lock API. It is expected that the calling application has done all necessary security checks before requesting a lock be granted.
abstract public setLock ( string $requestor, string $scope, string $principal, integer $lifetime = 1, $exclusive = Horde_Lock::TYPE_SHARED ) : mixed
$requestor string User ID of the lock requestor.
$scope string The scope of the lock. Typically the name of the application requesting the lock or some other identifier used to group locks together.
$principal string A principal on which a lock should be granted. The format can be any string but is suggested to be in URI form.
$lifetime integer Time (in seconds) for which the lock will be considered valid.
리턴 mixed A string lock ID.

프로퍼티 상세

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

Logger.
protected Horde_Log_Logger $_logger
리턴 Horde_Log_Logger

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

Driver parameters.
protected array $_params
리턴 array