當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Redis::flushDB方法代碼示例

本文整理匯總了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'));
 }
開發者ID:bicatu,項目名稱:php-circuit-breaker,代碼行數:7,代碼來源:RedisAdapterTest.php

示例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);
 }
開發者ID:treehouselabs,項目名稱:io-bundle,代碼行數:15,代碼來源:RedisRequestLoggerTest.php

示例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;
 }
開發者ID:ehough,項目名稱:stash,代碼行數:18,代碼來源:Redis.php

示例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;
 }
開發者ID:comodojo,項目名稱:cache,代碼行數:23,代碼來源:PhpRedisCache.php

示例5: flush

 /**
  * 清空所有數據
  *
  */
 public function flush()
 {
     return $this->connect->flushDB();
 }
開發者ID:ZhuJingfa,項目名稱:HuiLib,代碼行數:8,代碼來源:Redis.php

示例6: flush

 /**
  * @inheritdoc
  */
 public function flush()
 {
     return $this->redis->flushDB();
 }
開發者ID:lixiongyou,項目名稱:pudding,代碼行數:7,代碼來源:Redis.php

示例7: drop

 /**
  * Clears all values from the cache.
  *
  * @return mixed
  */
 public function drop()
 {
     $this->redis->flushDB();
     $this->dropChain();
 }
開發者ID:nilportugues,項目名稱:cache,代碼行數:10,代碼來源:AbstractAdapter.php

示例8: flushDB

 public function flushDB()
 {
     return (bool) $this->redis->flushDB();
 }
開發者ID:vaidasif,項目名稱:symfony-force,代碼行數:4,代碼來源:RedisCache.php

示例9: flush

 /**
  * @inheritdoc
  */
 public function flush()
 {
     $this->checkClientConnection();
     $this->client->flushDB();
 }
開發者ID:flowpack,項目名稱:jobqueue-redis,代碼行數:8,代碼來源:RedisQueue.php

示例10: delete_all

 public function delete_all()
 {
     $this->_redis->flushDB();
 }
開發者ID:sttt,項目名稱:phpredis-kohana3.3,代碼行數:4,代碼來源:Redis.php

示例11: testdbSize

 public function testdbSize()
 {
     $this->assertTrue($this->redis->flushDB());
     $this->redis->set('x', 'y');
     $this->assertTrue($this->redis->dbSize() === 1);
 }
開發者ID:stonegithubs,項目名稱:phpredis,代碼行數:6,代碼來源:TestRedis.php

示例12: flush

 /**
  * Removes all the entries from the default Redis database
  *
  * @internal
  */
 public function flush()
 {
     $this->redisCli->flushDB();
 }
開發者ID:contatta,項目名稱:qless-php,代碼行數:9,代碼來源:Lua.php

示例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 */
開發者ID:isS,項目名稱:NoSQL,代碼行數:31,代碼來源:phpRedis.php

示例14: clean

 /**
  * @inheritdoc
  */
 public function clean()
 {
     return $this->driver->flushDB();
 }
開發者ID:dp-ifacesoft,項目名稱:micro,代碼行數:7,代碼來源:RedisCache.php

示例15: clearAll

 /**
  * Clear all
  * @return boolean success or failure
  */
 public function clearAll()
 {
     return $this->connect->flushDB();
 }
開發者ID:stevleibelt,項目名稱:CacheStore,代碼行數:8,代碼來源:Redis.php


注:本文中的Redis::flushDB方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。