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


PHP Redis::flushAll方法代碼示例

本文整理匯總了PHP中Redis::flushAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP Redis::flushAll方法的具體用法?PHP Redis::flushAll怎麽用?PHP Redis::flushAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Redis的用法示例。


在下文中一共展示了Redis::flushAll方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 /**
  * @requires extension redis
  */
 protected function setUp()
 {
     if (!extension_loaded('redis')) {
         $this->markTestSkipped('redis extension not installed');
     }
     $this->redis = new \Redis();
     if (false === @$this->redis->connect('127.0.0.1')) {
         unset($this->redis);
         $this->markTestSkipped('Could not connect to Redis instance');
     }
     $this->redis->flushAll();
     parent::setUp();
 }
開發者ID:savritsky,項目名稱:cache,代碼行數:16,代碼來源:RedisDriverTest.php

示例2: clearAll

	/**
	 * 清空數據
	 */
	public function clearAll() {
		try {
			return $this->_redis->flushAll();
		} catch (Exception $e) {
			$this->_error = $e->getMessage();
			return false;
		}
	}
開發者ID:neil-chen,項目名稱:NeilChen,代碼行數:11,代碼來源:RedisCache.class.php

示例3: delete

 /**
  * 刪除指定key的緩存,若$key===true則表示刪除全部
  *
  * @param string $key
  */
 public function delete($key)
 {
     $this->_connect();
     if ($key === true) {
         return $this->_redis->flushAll();
     } else {
         $keys = func_get_args();
         return $this->_redis->delete($keys);
     }
 }
開發者ID:xiaodin1,項目名稱:myqee,代碼行數:15,代碼來源:redis.class.php

示例4: flush

 /**
  * Flush all data from the cache server?
  */
 public function flush()
 {
     if ($this->connected === true && $this->ping() === true) {
         if ($this->isRedis === true) {
             $this->server->flushAll();
         } else {
             $this->server->flush();
         }
     }
 }
開發者ID:sebst3r,項目名稱:nZEDb,代碼行數:13,代碼來源:Cache.php

示例5: setUpBeforeClass

 public static function setUpBeforeClass()
 {
     if (!extension_loaded('redis')) {
         static::$cache = null;
         return;
     }
     $redis = new \Redis();
     $redis->connect('127.0.0.1');
     $redis->select(1);
     $redis->flushAll();
     static::$cache = new \Cachalot\RedisCache($redis, 'cachalot-test:');
 }
開發者ID:ihor,項目名稱:cachalot,代碼行數:12,代碼來源:RedisCacheTest.php

示例6: connectRedis

 public function connectRedis($host, $port, $db)
 {
     // Cache in Redis
     $cacheRedis = new Redis();
     $cacheRedis->connect($host, $port);
     $cacheRedis->select($db);
     $cacheResult = $cacheRedis->flushAll();
     if ($cacheResult == 1) {
         Mage::getSingleton('core/session')->addSuccess(Mage::helper('gaugeinteractive_redis')->__('Redis has been flushed.'));
     } else {
         Mage::getSingleton('core/session')->addError(Mage::helper('gaugeinteractive_redis')->__('An error occurred when flushing Redis.'));
     }
 }
開發者ID:ethansx,項目名稱:easy-button,代碼行數:13,代碼來源:Cache.php

示例7: Redis

 function my_onStart($serv)
 {
     $redis = new Redis();
     $redis->pconnect('127.0.0.1', 6379);
     $redis->flushAll();
     $work_arr = array();
     for ($i = 0; $i < $serv->setting['task_worker_num']; $i++) {
         $redis->lpush('free', $i);
         $work_arr[] = $i;
     }
     echo "MasterPid={$serv->master_pid}|Manager_pid={$serv->manager_pid}\n";
     echo "Server: start.Swoole version is [" . SWOOLE_VERSION . "]\n";
 }
開發者ID:hytzxd,項目名稱:swoole-doc,代碼行數:13,代碼來源:ServerCommand.php

示例8: delete

 /**
  * 刪除指定key的緩存
  *
  * 若 `$key===true` 則表示刪除全部
  *
  *      // 支持下麵的方式
  *      $this->delete('abc');
  *      $this->delete('abc', 'abc2');
  *      $this->delete(['abc', 'abc2']);
  *
  *      // 刪除全部
  *      $this->delete(true);
  *      // 也可使用
  *      $this->delete_all();
  *
  * @param string|array|true $key
  */
 public function delete($key)
 {
     $this->_connect();
     if (true === $key) {
         return $this->_redis->flushAll();
     } else {
         if (is_array($key)) {
             $keys = $key;
         } else {
             $keys = func_get_args();
         }
         return $this->_redis->delete($keys);
     }
 }
開發者ID:xiaodin1,項目名稱:myqee,代碼行數:31,代碼來源:redis.class.php

示例9: flush

 /**
  * Flush all data from the cache server?
  */
 public function flush()
 {
     if ($this->ping()) {
         switch (NN_CACHE_TYPE) {
             case self::TYPE_REDIS:
                 $this->server->flushAll();
                 break;
             case self::TYPE_MEMCACHED:
                 $this->server->flush();
                 break;
             case self::TYPE_APC:
                 apc_clear_cache("user");
                 apc_clear_cache();
                 break;
         }
     }
 }
開發者ID:RickDB,項目名稱:newznab-tmux,代碼行數:20,代碼來源:Cache.php

示例10: deleteAll

 /**
  * Remove all items from the cache (flush it).
  *
  * @return void
  */
 function deleteAll()
 {
     $this->connection->flushAll();
 }
開發者ID:digitalcreations,項目名稱:cache-phpredis,代碼行數:9,代碼來源:Cache.php

示例11: clear

 /**
  * Deletes all cache entries
  *
  * @return bool
  */
 public function clear()
 {
     return $this->cache->flushAll();
 }
開發者ID:ihor,項目名稱:cachalot,代碼行數:9,代碼來源:RedisCache.php

示例12: testflushAll

 public function testflushAll()
 {
     $this->redis->set('x', 'y');
     $this->assertTrue($this->redis->flushAll());
     $this->assertTrue($this->redis->getKeys('*') === array());
 }
開發者ID:virtulis,項目名稱:phpredis,代碼行數:6,代碼來源:TestRedis.php

示例13: clear

 public function clear()
 {
     $this->redis->flushAll();
 }
開發者ID:jellycheng,項目名稱:windframework,代碼行數:4,代碼來源:WindRedisCache.php

示例14: flush

 public function flush()
 {
     $this->redis->flushAll();
 }
開發者ID:icambridge,項目名稱:hoard,代碼行數:4,代碼來源:Redis.php

示例15: array

<?php

// change the following paths if necessary
require_once 'inc/tags/lib/Loader.class.php';
WF_Loader::registerAutoload();
require_once "inc/tags/TagArticles.inc.php";
require_once "inc/tags/Tag.inc.php";
require_once "inc/tags/ArticleTags.inc.php";
require_once "inc/tags/ArticleMini.inc.php";
require_once "inc/tags/TagsKey.inc.php";
require_once "inc/tags/TagSite.inc.php";
require __DIR__ . '/fixtures/util.func.php';
$conf = (require __DIR__ . '/config/test.conf.php');
define("ROOT_DIR", __DIR__);
WF_Registry::set('logger', new WF_Logger());
$instance = WF_Db::instance($conf['db']);
WF_Registry::set('db', $instance);
unset($instance);
WF_DbTestCase::setBasePath(ROOT_DIR . "/fixtures");
WF_Event::bind('addArticleTag', array(TagArticles::model(), 'onAddArticleTag'));
WF_Event::bind('removeArticleTag', array(TagArticles::model(), 'onRemoveArticleTag'));
$redis = new Redis();
$redis_config = $conf['redis'];
$redis->connect($redis_config['host'], $redis_config['port']);
$redis->flushAll();
WF_Registry::set('cache', $redis);
WF_Registry::set('redis', $redis);
WF_Config::set('tagitem_use_cache', true);
TagSite::refresh(__DIR__ . '/data/sites.dat');
$id = TagSite::getSiteId('news');
開發者ID:reedboat,項目名稱:TagProject,代碼行數:30,代碼來源:bootstrap.php


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