You are here

class Redis_Client_Predis in Redis 7

Same name and namespace in other branches
  1. 7.3 lib/Redis/Client/Predis.php \Redis_Client_Predis
  2. 7.2 lib/Redis/Client/Predis.php \Redis_Client_Predis

Predis client specific implementation.

Hierarchy

Expanded class hierarchy of Redis_Client_Predis

2 string references to 'Redis_Client_Predis'
predis.cache.inc in ./predis.cache.inc
Placeholder file for using the Predis cache backend. This file will also ensure the client handling API is fully loaded for lock backend.
predis.lock.inc in ./predis.lock.inc
Drupal core lock.inc implementation using Redis via Predis library.

File

lib/Redis/Client/Predis.php, line 36

View source
class Redis_Client_Predis implements Redis_Client_Interface {
  public function getClient($host = NULL, $port = NULL, $base = NULL) {
    $connectionInfo = array(
      'host' => $host,
      'port' => $port,
      'database' => $base,
    );
    foreach ($connectionInfo as $key => $value) {
      if (!isset($value)) {
        unset($connectionInfo[$key]);
      }
    }
    return new Predis\Client($connectionInfo);
  }
  public function getName() {
    return 'Predis';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Redis_Client_Predis::getClient public function Get the connected client instance. Overrides Redis_Client_Interface::getClient
Redis_Client_Predis::getName public function Get underlaying library name used. Overrides Redis_Client_Interface::getName