PHP Class Horde_Lock_Sql, horde
The table structure for the locks is as follows:
CREATE TABLE horde_locks (
lock_id VARCHAR(36) NOT NULL,
lock_owner VARCHAR(32) NOT NULL,
lock_scope VARCHAR(32) NOT NULL,
lock_principal VARCHAR(255) NOT NULL,
lock_origin_timestamp BIGINT NOT NULL,
lock_update_timestamp BIGINT NOT NULL,
lock_expiry_timestamp BIGINT NOT NULL,
lock_type TINYINT NOT NULL,
PRIMARY KEY (lock_id)
);
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.
Mostrar archivo
Open project: horde/horde
Public Methods
Method |
Description |
|
__construct ( array $params = [] ) |
Constructor. |
|
clearLock ( $lockid ) |
Removes a lock given the lock ID. |
|
doGC ( ) |
Do garbage collection needed for the driver. |
|
getLockInfo ( $lockid ) |
Return an array of information about the requested lock. |
|
getLocks ( $scope = null, $principal = null, $type = null ) |
Return a list of valid locks with the option to limit the results
by principal, scope and/or type. |
|
resetLock ( $lockid, $lifetime ) |
Extend the valid lifetime of a valid lock to now + $lifetime. |
|
setLock ( $requestor, $scope, $principal, $lifetime = 1, $type = Horde_Lock::TYPE_SHARED ) |
Sets a lock on the requested principal and returns the generated lock
ID. |
|
Method Details
__construct()
public method
public __construct ( array $params = [] ) |
$params |
array |
Parameters:
'db' - (Horde_Db_Adapter) [REQUIRED] The DB instance.
'table' - (string) The name of the lock table in 'database'.
DEFAULT: 'horde_locks'
|
clearLock()
public method
Removes a lock given the lock ID.
Do garbage collection needed for the driver.
getLockInfo()
public method
Return an array of information about the requested lock.
Return a list of valid locks with the option to limit the results
by principal, scope and/or type.
public getLocks ( $scope = null, $principal = null, $type = null ) |
resetLock()
public method
Extend the valid lifetime of a valid lock to now + $lifetime.
Sets a lock on the requested principal and returns the generated lock
ID.
public setLock ( $requestor, $scope, $principal, $lifetime = 1, $type = Horde_Lock::TYPE_SHARED ) |