当前位置: 首页>>代码示例>>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;未经允许,请勿转载。