本文整理汇总了PHP中Redis::flushDB方法的典型用法代码示例。如果您正苦于以下问题:PHP Redis::flushDB方法的具体用法?PHP Redis::flushDB怎么用?PHP Redis::flushDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redis
的用法示例。
在下文中一共展示了Redis::flushDB方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSaveClear
public function testSaveClear()
{
$x = "valB";
$this->_adapter->saveStatus('AAA', 'BBB', $x);
$this->_connection->flushDB();
$this->assertEquals("", $this->_adapter->loadStatus('AAA', 'BBB'));
}
示例2: getLogger
/**
* @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: clear
/**
* {@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: flush
/**
* 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: flush
/**
* 清空所有数据
*
*/
public function flush()
{
return $this->connect->flushDB();
}
示例6: flush
/**
* @inheritdoc
*/
public function flush()
{
return $this->redis->flushDB();
}
示例7: drop
/**
* Clears all values from the cache.
*
* @return mixed
*/
public function drop()
{
$this->redis->flushDB();
$this->dropChain();
}
示例8: flushDB
public function flushDB()
{
return (bool) $this->redis->flushDB();
}
示例9: flush
/**
* @inheritdoc
*/
public function flush()
{
$this->checkClientConnection();
$this->client->flushDB();
}
示例10: delete_all
public function delete_all()
{
$this->_redis->flushDB();
}
示例11: testdbSize
public function testdbSize()
{
$this->assertTrue($this->redis->flushDB());
$this->redis->set('x', 'y');
$this->assertTrue($this->redis->dbSize() === 1);
}
示例12: flush
/**
* Removes all the entries from the default Redis database
*
* @internal
*/
public function flush()
{
$this->redisCli->flushDB();
}
示例13: Redis
<?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: clean
/**
* @inheritdoc
*/
public function clean()
{
return $this->driver->flushDB();
}
示例15: clearAll
/**
* Clear all
* @return boolean success or failure
*/
public function clearAll()
{
return $this->connect->flushDB();
}