/** * Create a new lock backend with a generated lock id * * @return Redis_Lock_BackendInterface */ public function createLockBackend() { if (!$this->getLockBackendClass()) { throw new \Exception("Lock backend class does not exist"); } $className = Redis_Client::getClass(Redis_Client::REDIS_IMPL_LOCK); return $this->backends[] = new $className(Redis_Client::getClient(), Redis_Client::getDefaultPrefix('lock')); }
/** * Get actual lock backend. * * @return Redis_Lock_Backend_Interface */ public static function getBackend() { if (!isset(self::$instance)) { $className = Redis_Client::getClass(Redis_Client::REDIS_IMPL_LOCK); self::$instance = new $className(); } return self::$instance; }
/** * Create a new lock backend with a generated lock id * * @return Redis_Lock_Backend_Interface */ public function createLockBackend() { $class = Redis_Client::getClass(Redis_Client::REDIS_IMPL_LOCK); if (!class_exists($class)) { throw new \Exception("Lock backend class does not exist"); } return $this->backends[] = new $class(); }
/** * Get cache backend * * @return Redis_Cache_Base */ protected final function getBackend() { if (null === $this->backend) { $class = Redis_Client::getClass(Redis_Client::REDIS_IMPL_CACHE); if (null === $class) { throw new \Exception("Test skipped due to missing driver"); } $this->backend = new $class('cache'); } return $this->backend; }
/** * Get cache backend * * @return Redis_Path_HashLookupInterface */ protected final function getBackend($name = null) { if (null === $name) { // This is needed to avoid conflict between tests, each test // seems to use the same Redis namespace and conflicts are // possible. $name = 'cache' . self::$id++; } $className = Redis_Client::getClass(Redis_Client::REDIS_IMPL_PATH); $hashLookup = new $className(Redis_Client::getClient(), 'path', Redis_Client::getDefaultPrefix('path')); return $hashLookup; }
public function __construct($bin) { $this->bin = $bin; $className = Redis_Client::getClass(Redis_Client::REDIS_IMPL_CACHE); $this->backend = new $className(Redis_Client::getClient(), $bin, Redis_Client::getDefaultPrefix($bin)); $this->refreshCapabilities(); $this->refreshPermTtl(); $this->refreshMaxTtl(); }
/** * Default contructor * * Beware that DrupalQueueInterface does not defines the __construct * method in the interface yet is being used from DrupalQueue::get() * * @param unknown $name */ public function __construct($name) { $className = Redis_Client::getClass(Redis_Client::REDIS_IMPL_QUEUE); $this->backend = new $className($name); }
public function __construct($namespace) { parent::__construct($namespace); $className = Redis_Client::getClass(Redis_Client::REDIS_IMPL_CACHE); $this->backend = new $className($this->getKey()); $this->refreshClearMode(); $this->refreshPermTtl(); $this->refreshMaxTtl(); }
function __construct($bin) { $className = Redis_Client::getClass(Redis_Client::REDIS_IMPL_CACHE); $this->backend = new $className($bin); }