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); }
/** * {@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; }
/** * 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; }
/** * 清空所有数据 * */ public function flush() { return $this->connect->flushDB(); }
/** * @inheritdoc */ public function flush() { return $this->redis->flushDB(); }
/** * Clears all values from the cache. * * @return mixed */ public function drop() { $this->redis->flushDB(); $this->dropChain(); }
public function flushDB() { return (bool) $this->redis->flushDB(); }
/** * @inheritdoc */ public function flush() { $this->checkClientConnection(); $this->client->flushDB(); }
public function delete_all() { $this->_redis->flushDB(); }
public function testdbSize() { $this->assertTrue($this->redis->flushDB()); $this->redis->set('x', 'y'); $this->assertTrue($this->redis->dbSize() === 1); }
/** * Removes all the entries from the default Redis database * * @internal */ public function flush() { $this->redisCli->flushDB(); }
<?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 */
/** * @inheritdoc */ public function clean() { return $this->driver->flushDB(); }
/** * Clear all * @return boolean success or failure */ public function clearAll() { return $this->connect->flushDB(); }
/** * remove the queue resource * @return mixed */ public function remove() { return $this->redis->flushDB(); }
/** * @return mixed */ public function flush() { return $this->_cache->flushDB(); }
/** * Clean cache * * @return bool * @see Redis::flushDB() */ public function clean() { return $this->_redis->flushDB(); }
/** * 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(); } }