当前位置: 首页>>代码示例>>PHP>>正文


PHP Memcached::flush方法代码示例

本文整理汇总了PHP中Memcached::flush方法的典型用法代码示例。如果您正苦于以下问题:PHP Memcached::flush方法的具体用法?PHP Memcached::flush怎么用?PHP Memcached::flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Memcached的用法示例。


在下文中一共展示了Memcached::flush方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: flush

 public function flush()
 {
     if (!$this->memcached) {
         throw new CacheException('No memcached defined.');
     }
     $this->memcached->flush();
 }
开发者ID:enyo,项目名称:rincewind,代码行数:7,代码来源:MemcachedCache.php

示例2: testSaveClear

 public function testSaveClear()
 {
     $x = "valB";
     $this->_adapter->saveStatus('AAA', 'BBB', $x);
     $this->_connection->flush();
     $this->assertEquals("", $this->_adapter->loadStatus('AAA', 'BBB'));
 }
开发者ID:rockefys,项目名称:php-circuit-breaker,代码行数:7,代码来源:MemcachedAdapterTest.php

示例3: setUp

 public function setUp()
 {
     self::$memcached->flush();
     self::$memcached->quit();
     $this->storage = new MemcachedStorage(self::$memcached);
     $this->tokenBucket = new TokenBucket('test', $this->storage);
 }
开发者ID:fustundag,项目名称:tokenbucket,代码行数:7,代码来源:TokenBucketTest.php

示例4: setUp

 public function setUp()
 {
     self::$memcached->flush();
     self::$memcached->quit();
     self::$memcached->set('found', array('count' => 5, 'time' => strtotime('2015-01-01 00:00:00')));
     self::$memcached->set('oldkey', 'old story');
     $this->storage = new MemcachedStorage(self::$memcached);
 }
开发者ID:fustundag,项目名称:tokenbucket,代码行数:8,代码来源:MemcachedTest.php

示例5: clear

 function clear()
 {
     $this->memcached->flush();
     //        $val = $this->memcached->get($key);
     //        if($val !== false) {
     //            $this->memcached->delete($key);
     //        }
     // TODO: Implement clear() method.
 }
开发者ID:ArmineKhachatryan,项目名称:A7,代码行数:9,代码来源:MemcachedCache.php

示例6: clean

 /**
  * @return PeclMemcached
  **/
 public function clean()
 {
     $this->ensureTriedToConnect();
     try {
         $this->instance->flush();
     } catch (BaseException $e) {
         $this->alive = false;
     }
     return parent::clean();
 }
开发者ID:justthefish,项目名称:hesper,代码行数:13,代码来源:PeclMemcached.php

示例7: setUp

 public function setUp()
 {
     parent::setUp();
     $this->memcache = new \Memcached();
     $this->memcache->addServer(self::TEST_MEMCACHE_SERVER, self::TEST_MEMCACHE_PORT);
     $this->memcache->flush();
     if (!$this->memcache->set('test', 1, time() + 100)) {
         throw new \RuntimeException('Cannot save item to memcache. ' . $this->memcache->getResultMessage());
     }
 }
开发者ID:hergot,项目名称:databroker,代码行数:10,代码来源:MemcachedCacheBackendTest.php

示例8: flushAction

 public function flushAction()
 {
     #var_dump($this->memcached->getAllKeys());
     $result = $this->memcached->flush();
     #var_dump($this->memcached->getAllKeys());
     #die();
     if (!$result) {
         throw new \RuntimeException("Could not flush");
     }
     return $this->redirectToReferrer();
 }
开发者ID:asgrim,项目名称:zdt-memcache,代码行数:11,代码来源:IndexController.php

示例9: setUp

 /**
  * @inheritDoc
  */
 protected function setUp()
 {
     parent::setUp();
     /* Create the memcached client. */
     $this->client = new \Memcached();
     $this->client->addServer('127.0.0.1', 11211);
     /* Flush the server */
     $this->client->flush();
     /* Create the provider instance. */
     $options = array(ProviderServiceInterface::PROVIDER_OPT_PREFIX => 'my_prefix', ProviderServiceInterface::PROVIDER_OPT_SEPARATOR => ':');
     $this->provider = new MemcachedProviderService($this->client, $options);
 }
开发者ID:ebidtech,项目名称:cache-client,代码行数:15,代码来源:MemcachedProviderServiceTest.php

示例10: setUp

 /**
  * @requires extension memcached
  */
 protected function setUp()
 {
     if (!extension_loaded('memcached')) {
         $this->markTestSkipped('memcached extension not installed');
     }
     $this->memcached = new \Memcached();
     $this->memcached->addServer('127.0.0.1', 11211);
     $this->memcached->flush();
     if (@fsockopen('127.0.0.1', 11211) === false) {
         unset($this->memcached);
         $this->markTestSkipped('Could not connect to Memcached instance');
     }
     parent::setUp();
 }
开发者ID:savritsky,项目名称:cache,代码行数:17,代码来源:MemcachedDriverTest.php

示例11: setUp

 protected function setUp()
 {
     $client = new \Memcached();
     $client->addServer('localhost', 11211);
     $client->flush();
     $this->cache = new OffloadCacheMemcached($client);
 }
开发者ID:aol,项目名称:offload,代码行数:7,代码来源:OffloadCacheMemcachedTest.php

示例12: internalClear

 /**
  * Internal method to clear items off all namespaces.
  *
  * @param  int   $normalizedMode Matching mode (Value of Adapter::MATCH_*)
  * @param  array $normalizedOptions
  * @return boolean
  * @throws Exception\ExceptionInterface
  * @see    clearByNamespace()
  */
 protected function internalClear(&$normalizedMode, array &$normalizedOptions)
 {
     if (!$this->memcached->flush()) {
         throw $this->getExceptionByResultCode($this->memcached->getResultCode());
     }
     return true;
 }
开发者ID:brikou,项目名称:zend_cache,代码行数:16,代码来源:Memcached.php

示例13: flush

 /**
  * Flush all existing items in storage.
  *
  * @return  boolean
  *
  * @since   3.6.3
  */
 public function flush()
 {
     if (!$this->lockindex()) {
         return false;
     }
     return static::$_db->flush();
 }
开发者ID:iFactoryDigital,项目名称:gympieradiology,代码行数:14,代码来源:memcached.php

示例14: flush

 /**
  * Flush all existing items at the server
  * @return bool
  */
 public function flush()
 {
     if ($this->enabled === false) {
         return true;
     }
     return $this->memcached->flush();
 }
开发者ID:netzdenke,项目名称:phpmcached,代码行数:11,代码来源:PHPMCached.php

示例15: getMemcached

 /**
  * @return \Memcached
  */
 protected function getMemcached()
 {
     $Memcached = new \Memcached();
     $Memcached->addServers($this->getTestServers());
     $Memcached->flush();
     return $Memcached;
 }
开发者ID:cheprasov,项目名称:php-parallel,代码行数:10,代码来源:MemcachedStorageTest.php


注:本文中的Memcached::flush方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。