Пример #1
0
 /**
  * @return BaseAggregateCache
  **/
 protected function doAddPeer($label, CachePeer $peer)
 {
     if (isset($this->peers[$label])) {
         throw new WrongArgumentException('use unique names for your peers');
     }
     if ($peer->isAlive()) {
         $this->alive = true;
     }
     $this->peers[$label]['object'] = $peer;
     $this->peers[$label]['stat'] = [];
     return $this;
 }
Пример #2
0
 /**
  * @return PeclMemcache
  **/
 public function clean()
 {
     try {
         $this->instance->flush();
     } catch (BaseException $e) {
         $this->alive = false;
     }
     return parent::clean();
 }
Пример #3
0
 /**
  * @return PeclMemcached
  **/
 public function clean()
 {
     $this->ensureTriedToConnect();
     try {
         $this->instance->flush();
     } catch (BaseException $e) {
         $this->alive = false;
     }
     return parent::clean();
 }
Пример #4
0
 public function isAlive()
 {
     $this->ensureTriedToConnect();
     try {
         $this->alive = $this->redis->ping() == '+PONG';
     } catch (\RedisException $e) {
         $this->alive = false;
     }
     return parent::isAlive();
 }
Пример #5
0
 /**
  * @return SocketMemcached
  **/
 public function clean()
 {
     if (!$this->link) {
         $this->alive = false;
         return null;
     }
     $this->sendRequest("flush_all\r\n");
     // flushing obligatory response - "OK\r\n"
     fread($this->link, 4);
     return parent::clean();
 }
Пример #6
0
 /**
  * @return RubberFileSystem
  **/
 public function clean()
 {
     // just to return 'true'
     FileUtils::removeDirectory($this->directory, true);
     return parent::clean();
 }
Пример #7
0
 public function getList($indexes)
 {
     return $this->innerPeer->getList($indexes);
 }