當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。