class PhpRedis in Redis 8
Same name in this branch
- 8 src/Lock/PhpRedis.php \Drupal\redis\Lock\PhpRedis
- 8 src/Flood/PhpRedis.php \Drupal\redis\Flood\PhpRedis
- 8 src/Queue/PhpRedis.php \Drupal\redis\Queue\PhpRedis
- 8 src/Client/PhpRedis.php \Drupal\redis\Client\PhpRedis
- 8 src/Cache/PhpRedis.php \Drupal\redis\Cache\PhpRedis
- 8 src/PersistentLock/PhpRedis.php \Drupal\redis\PersistentLock\PhpRedis
PHpRedis persistent lock backend
Hierarchy
- class \Drupal\Core\Lock\LockBackendAbstract implements LockBackendInterface
- class \Drupal\redis\Lock\PhpRedis uses RedisPrefixTrait
- class \Drupal\redis\PersistentLock\PhpRedis
- class \Drupal\redis\Lock\PhpRedis uses RedisPrefixTrait
Expanded class hierarchy of PhpRedis
4 string references to 'PhpRedis'
- ClientFactory::getClientInterface in src/
ClientFactory.php - Lazy instantiates client proxy depending on the actual configuration.
- PhpRedis::getName in src/
Client/ PhpRedis.php - Get underlying library name used.
- RedisCacheTagsChecksum::doInvalidateTags in src/
Cache/ RedisCacheTagsChecksum.php - Marks cache items with any of the specified tags as invalid.
- RedisTestInterfaceTrait::getRedisInterfaceEnv in tests/
src/ Traits/ RedisTestInterfaceTrait.php - Uses an env variable to set the redis client to use for this test.
File
- src/
PersistentLock/ PhpRedis.php, line 10
Namespace
Drupal\redis\PersistentLockView source
class PhpRedis extends \Drupal\redis\Lock\PhpRedis {
/**
* Creates a PHpRedis persistent lock backend.
*/
public function __construct(ClientFactory $factory) {
// Do not call the parent constructor to avoid registering a shutdown
// function that releases all the locks at the end of a request.
$this->client = $factory
->getClient();
// Set the lockId to a fixed string to make the lock ID the same across
// multiple requests. The lock ID is used as a page token to relate all the
// locks set during a request to each other.
// @see \Drupal\Core\Lock\LockBackendInterface::getLockId()
$this->lockId = 'persistent';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LockBackendAbstract:: |
protected | property | Current page lock token identifier. | |
LockBackendAbstract:: |
protected | property | Existing locks for this page. | |
LockBackendAbstract:: |
public | function |
Gets the unique page token for locks. Overrides LockBackendInterface:: |
|
LockBackendAbstract:: |
public | function |
Waits a short amount of time before a second lock acquire attempt. Overrides LockBackendInterface:: |
|
PhpRedis:: |
protected | property | ||
PhpRedis:: |
public | function |
Acquires a lock. Overrides LockBackendInterface:: |
|
PhpRedis:: |
protected | function | Generate a redis key name for the current lock name. | |
PhpRedis:: |
public | function |
Checks if a lock is available for acquiring. Overrides LockBackendInterface:: |
|
PhpRedis:: |
public | function |
Releases the given lock. Overrides LockBackendInterface:: |
|
PhpRedis:: |
public | function |
Releases all locks for the given lock token identifier. Overrides LockBackendInterface:: |
|
PhpRedis:: |
public | function |
Creates a PHpRedis persistent lock backend. Overrides PhpRedis:: |
|
RedisPrefixTrait:: |
protected | property | ||
RedisPrefixTrait:: |
protected | function | Get global default prefix | |
RedisPrefixTrait:: |
protected | function | Get prefix | |
RedisPrefixTrait:: |
public | function | Set prefix |