public function testSaveClear()
 {
     $x = "valB";
     $this->_adapter->saveStatus('AAA', 'BBB', $x);
     $this->_connection->flushDB();
     $this->assertEquals("", $this->_adapter->loadStatus('AAA', 'BBB'));
 }
 /**
  * @inheritdoc
  */
 protected function getLogger()
 {
     if (!extension_loaded('redis')) {
         $this->markTestSkipped('Redis extension not loaded');
     }
     $redis = new \Redis();
     if (false === $redis->connect('localhost', 6379, 1)) {
         $this->markTestSkipped('Could not connect to Redis server');
     }
     $redis->flushDB();
     return new RedisRequestLogger($redis);
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function clear($key = null)
 {
     if (is_null($key)) {
         $this->redis->flushDB();
         return true;
     }
     $keyString = $this->makeKeyString($key, true);
     $keyReal = $this->makeKeyString($key);
     $this->redis->incr($keyString);
     // increment index for children items
     $this->redis->delete($keyReal);
     // remove direct item.
     $this->keyCache = array();
     return true;
 }
Пример #4
0
 /**
  * Clean cache objects in all namespaces
  *
  * This method will throw only logical exceptions.
  *
  * @return  bool
  * @throws \Comodojo\Exception\CacheException
  */
 public function flush()
 {
     if (!$this->isEnabled()) {
         return false;
     }
     $this->resetErrorState();
     try {
         $this->instance->flushDB();
     } catch (RedisException $re) {
         $this->raiseError("Server unreachable (PhpRedis), exiting gracefully", array("RESULTCODE" => $re->getCode(), "RESULTMESSAGE" => $re->getMessage()));
         $this->setErrorState();
         return false;
     }
     return true;
 }
Пример #5
0
 /**
  * 清空所有数据
  *
  */
 public function flush()
 {
     return $this->connect->flushDB();
 }
Пример #6
0
 /**
  * @inheritdoc
  */
 public function flush()
 {
     return $this->redis->flushDB();
 }
Пример #7
0
 /**
  * Clears all values from the cache.
  *
  * @return mixed
  */
 public function drop()
 {
     $this->redis->flushDB();
     $this->dropChain();
 }
Пример #8
0
 public function flushDB()
 {
     return (bool) $this->redis->flushDB();
 }
Пример #9
0
 /**
  * @inheritdoc
  */
 public function flush()
 {
     $this->checkClientConnection();
     $this->client->flushDB();
 }
Пример #10
0
 public function delete_all()
 {
     $this->_redis->flushDB();
 }
Пример #11
0
 public function testdbSize()
 {
     $this->assertTrue($this->redis->flushDB());
     $this->redis->set('x', 'y');
     $this->assertTrue($this->redis->dbSize() === 1);
 }
Пример #12
0
 /**
  * Removes all the entries from the default Redis database
  *
  * @internal
  */
 public function flush()
 {
     $this->redisCli->flushDB();
 }
Пример #13
0
<?php

$redis = new Redis();
$redisException = new RedisException();
var_dump($redisException);
$redis->flushDB();
$redis->info();
$redis->info("COMMANDSTATS");
$redis->ifno("CPU");
$redis->lastSave();
$redis->resetStat();
$redis->save();
$redis->slaveof('10.0.1.7', 6379);
$redis->slowlog('get', 10);
$redis->slowlog('reset');
$redis->get('key');
$redis->get('key');
$redis->set('key', 'value', 10);
$redis->set('key', 'value', array('nx', 'ex' => 10));
$redis->set('key', 'value', array('xx', 'px' => 1000));
$redis->setex('key', 3600, 'value');
$redis->psetex('key', 100, 'value');
$redis->setnx('key', 'value');
$redis->set('key1', 'val1');
$redis->set('key2', 'val2');
$redis->set('key3', 'val3');
$redis->set('key4', 'val4');
$redis->delete('key1', 'key2');
/* return 2 */
$redis->delete(array('key3', 'key4'));
/* return 2 */
Пример #14
0
 /**
  * @inheritdoc
  */
 public function clean()
 {
     return $this->driver->flushDB();
 }
Пример #15
0
 /**
  * Clear all
  * @return boolean success or failure
  */
 public function clearAll()
 {
     return $this->connect->flushDB();
 }
Пример #16
0
 /**
  * remove the queue resource
  * @return mixed
  */
 public function remove()
 {
     return $this->redis->flushDB();
 }
Пример #17
0
 /**
  * @return mixed
  */
 public function flush()
 {
     return $this->_cache->flushDB();
 }
Пример #18
0
 /**
  * Clean cache
  *
  * @return	bool
  * @see		Redis::flushDB()
  */
 public function clean()
 {
     return $this->_redis->flushDB();
 }
Пример #19
0
 /**
  * Removes all cache entries of this cache.
  *
  * Scales O(1) with number of cache entries
  *
  * @return void
  * @api
  */
 public function flush()
 {
     if ($this->connected) {
         $this->redis->flushDB();
     }
 }