You are here

public function PhpRedis::__construct in Redis 8

Same name in this branch
  1. 8 src/Lock/PhpRedis.php \Drupal\redis\Lock\PhpRedis::__construct()
  2. 8 src/Flood/PhpRedis.php \Drupal\redis\Flood\PhpRedis::__construct()
  3. 8 src/Queue/PhpRedis.php \Drupal\redis\Queue\PhpRedis::__construct()
  4. 8 src/Cache/PhpRedis.php \Drupal\redis\Cache\PhpRedis::__construct()
  5. 8 src/PersistentLock/PhpRedis.php \Drupal\redis\PersistentLock\PhpRedis::__construct()

Creates a PHpRedis cache backend.

1 method overrides PhpRedis::__construct()
PhpRedis::__construct in src/PersistentLock/PhpRedis.php
Creates a PHpRedis persistent lock backend.

File

src/Lock/PhpRedis.php, line 24

Class

PhpRedis
Predis lock backend implementation.

Namespace

Drupal\redis\Lock

Code

public function __construct(ClientFactory $factory) {
  $this->client = $factory
    ->getClient();

  // __destruct() is causing problems with garbage collections, register a
  // shutdown function instead.
  drupal_register_shutdown_function([
    $this,
    'releaseAll',
  ]);
}