PHP Класс 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.
Автор: Ben Klang ([email protected])
Наследование: extends Horde_Lock
Показать файл Открыть проект

Открытые методы

Метод Описание
__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.

Описание методов

__construct() публичный Метод

Constructor.
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() публичный Метод

Removes a lock given the lock ID.
См. также: Horde_Lock_Base::clearLock()
public clearLock ( $lockid )

doGC() публичный Метод

Do garbage collection needed for the driver.
public doGC ( )

getLockInfo() публичный Метод

Return an array of information about the requested lock.
См. также: Horde_Lock_Base::getLockInfo()
public getLockInfo ( $lockid )

getLocks() публичный Метод

Return a list of valid locks with the option to limit the results by principal, scope and/or type.
См. также: Horde_Lock_Base::getLocks()
public getLocks ( $scope = null, $principal = null, $type = null )

resetLock() публичный Метод

Extend the valid lifetime of a valid lock to now + $lifetime.
См. также: Horde_Lock_Base::resetLock()
public resetLock ( $lockid, $lifetime )

setLock() публичный Метод

Sets a lock on the requested principal and returns the generated lock ID.
См. также: Horde_Lock_Base::setLock()
public setLock ( $requestor, $scope, $principal, $lifetime = 1, $type = Horde_Lock::TYPE_SHARED )