Beispiel #1
0
 public function __construct($options = array())
 {
     parent::__construct($options);
     $this->dbName = $this->optionable['db_name'];
     $this->collectionName = $this->optionable['collection_name'];
     $className = 'Mongo';
     // @codeCoverageIgnoreStart
     try {
         if (!class_exists($className)) {
             throw new DriverNotFoundException('Mongo driver not found');
         }
         $this->mongo = new $className();
     } catch (\MongoConnectionException $e) {
         throw new CacheNotReachableException('Mongo not reachable');
     }
     // @codeCoverageIgnoreEnd
 }
Beispiel #2
0
 public function __construct($options = array())
 {
     parent::__construct($options);
     $className = 'Predis\\Client';
     // @codeCoverageIgnoreStart
     if (!class_exists($className)) {
         throw new DriverNotFoundException('Predis driver not found');
     }
     // @codeCoverageIgnoreEnd
     $this->redis = new $className($this->optionable['servers']);
     // @codeCoverageIgnoreStart
     try {
         $this->redis->connect();
     } catch (ConnectionException $e) {
         throw new CacheNotReachableException('Redis not reachable');
     }
     // @codeCoverageIgnoreEnd
 }
 public function __construct($options = array())
 {
     parent::__construct($options);
     $className = 'Memcache';
     // @codeCoverageIgnoreStart
     // @codeCoverageIgnoreEnd
     // @codeCoverageIgnoreStart
     if (!class_exists($className)) {
         throw new DriverNotFoundException('Memcache driver not found');
     }
     // @codeCoverageIgnoreEnd
     $this->memcache = new $className();
     $isConnected = $this->memcache->connect($this->optionable['server'], $this->optionable['port']);
     // @codeCoverageIgnoreStart
     if (!$isConnected) {
         throw new CacheNotReachableException('Memcache not reachable');
     }
     // @codeCoverageIgnoreEnd
 }
Beispiel #4
0
 public function deleteSentinel()
 {
     $this->cache->clearItem($this->getKey());
     //        $this->monoLogger->setLog(self::LOG_TYPE_CIA,
     //                "deleted key:" . $this->getKey());
 }