Horde_Lock constructor
-
array
$params: Parameters for the specific Horde_Lock driver
Removes a lock given the 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 cleared.
mixed
clearLock
(string $lockid)
-
string
$lockid: The lock ID as generated by a previous call to setLock()
Redefined in descendants as:
Attempts to return a concrete Horde_Lock instance based on $driver.
Horde_Lock
factory
(
mixed $driver, [
array $params =
null])
-
mixed
$driver: The type of concrete Horde_Lock subclass to return. This is based on the storage driver ($driver). The code is dynamically included. If $driver is an array, then we will look in $driver[0]/lib/Lock/ for the subclass implementation named $driver[1].php.
-
array
$params: A hash containing any additional configuration or connection parameters a subclass might need.
Return an array of information about the requested lock.
mixed
getLockInfo
(string $lockid)
-
string
$lockid: Lock ID to look up
Redefined in descendants as:
Return a list of valid locks with the option to limit the results by principal, scope and/or type.
mixed
getLocks
([string $scope = null], [string $principal = null], [int $type = null])
-
string
$scope: The scope of the lock. Typically the name of the application requesting the lock or some other identifier used to group locks together.
-
string
$principal: Principal for which to check for locks
-
int
$type: Only return locks of the given type. Defaults to null, or all locks
Redefined in descendants as:
Extend the valid lifetime of a valid lock to now + $extend.
mixed
resetLock
(string $lockid, int $extend)
-
string
$lockid: Lock ID to reset. Must be a valid, non-expired lock.
-
int
$extend: Extend lock this many seconds from now.
Redefined in descendants as:
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.
mixed
setLock
(string $requestor, string $scope, string $principal, [int $lifetime = 1], [string $exclusive = HORDE_LOCK_TYPE_SHARED])
-
string
$requestor: User ID of the lock requestor.
-
string
$scope: The scope of the lock. Typically the name of the application requesting the lock or some other identifier used to group locks together.
-
string
$principal: A principal on which a lock should be granted. The format can be any string but is suggested to be in URI form.
-
int
$lifetime: Time (in seconds) for which the lock will be considered valid.
-
string
$exclusive: exclusive One of HORDE_LOCK_TYPE_SHARED or HORDE_LOCK_TYPE_EXCLUSIVE.
- An exclusive lock will be enforced strictly
and must be interpreted to mean that the
resource can not be modified. Only one
exclusive lock per principal is allowed.
- A shared lock is one that notifies other
potential lock requestors that the resource
is in use. This lock can be overridden
(cleared or replaced with a subsequent
call to setLock()) by other users. Multiple
users may request (and will be granted) a
shared lock on a given principal. All locks
will be considered valid until they are
cleared or expire.
Redefined in descendants as:
Attempts to return a reference to a concrete Horde_Lock instance based on $driver. It will only create a new instance if no Horde_Lock instance with the same parameters currently exists.
This should be used if multiple authentication sources (and, thus, multiple Horde_Lock instances) are required.
This method must be invoked as: $var = &Horde_Lock::singleton()
Horde_Lock
&singleton
(
string $driver, [
array $params =
null])
-
string
$driver: The type of concrete Horde_Lock subclass to return. This is based on the storage driver ($driver). The code is dynamically included.
-
array
$params: A hash containing any additional configuration or connection parameters a subclass might need.
Generate a new Universally Unique Identifier for use as lock token
Borrowed from HTTP_WebDAV_Server::_new_uuid()
string
_uuidgen
(void 0)