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


PHP Memcache::flush方法代碼示例

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


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

示例1: tearDown

 /**
  * Tears down the fixture, for example, closes a network connection.
  * This method is called after a test is executed.
  */
 protected function tearDown()
 {
     \Gacela\Gacela::reset();
     if (is_object($this->memcache)) {
         $this->memcache->flush();
     }
 }
開發者ID:energylab,項目名稱:gacela,代碼行數:11,代碼來源:GacelaTest.php

示例2: DeleteAll

 /**
  * Invalidate all the objects in the cache
  * @return void
  */
 public function DeleteAll()
 {
     $this->objMemcache->flush();
     // needs to wait one second after flush.
     //  See comment on http://www.php.net/manual/ru/memcache.flush.php#81420
     sleep(1);
 }
開發者ID:vaibhav-kaushal,項目名稱:qc-framework,代碼行數:11,代碼來源:QCacheProviderMemcache.class.php

示例3: deleteAll

 function deleteAll()
 {
     if (null === $this->memcache) {
         $this->connect();
     }
     $this->memcache->flush();
 }
開發者ID:php-yaoi,項目名稱:php-yaoi,代碼行數:7,代碼來源:Memcache.php

示例4: clean

 /**
  * @return PeclMemcache
  **/
 public function clean()
 {
     try {
         $this->instance->flush();
     } catch (BaseException $e) {
         $this->alive = false;
     }
     return parent::clean();
 }
開發者ID:justthefish,項目名稱:hesper,代碼行數:12,代碼來源:PeclMemcache.php

示例5: checkCache

 function checkCache($check = 0, $in, $out, $set = 0)
 {
     $inOut = 'inOut_' . $in . '_' . $out;
     $memcache_obj = new Memcache();
     $memcache_obj->connect('127.0.0.1', 11211) or die("Could not connect");
     if ($check === 1) {
         $available = $memcache_obj->get($inOut);
         if (!$available) {
             $set = $this->superfastCheck(1, $in, $out);
             $memcache_obj->set($inOut, $set, false, 324);
             $available = $memcache_obj->get($inOut);
         }
     } elseif ($check === 2) {
         $memcache_obj->flush();
     } else {
         $set = $this->superfastCheck($in, $out);
         //var_dump($set);
         $memcache_obj->set($inOut, $set, false, 324);
         //echo $inOut;
         $available = $memcache_obj->get($inOut);
         //var_dump($memcache_obj->getStats());
     }
     //var_dump($available);
     $memcache_obj->close();
     return $available;
 }
開發者ID:Asgart,項目名稱:testapi,代碼行數:26,代碼來源:cache.php

示例6: setUp

 protected function setUp()
 {
     parent::setUp();
     if (\extension_loaded('memcache') && @fsockopen('localhost', 11211)) {
         $memcache = new \Memcache();
         $memcache->addServer('localhost');
         $memcache->flush();
         $cacheDriver = new \Doctrine\Common\Cache\MemcacheCache();
         $cacheDriver->setMemcache($memcache);
         $this->_em->getMetadataFactory()->setCacheDriver($cacheDriver);
     } else {
         if (\extension_loaded('apc')) {
             $this->_em->getMetadataFactory()->setCacheDriver(new \Doctrine\Common\Cache\ApcCache());
         } else {
             $this->markTestSkipped('Test only works with a cache enabled.');
         }
     }
     try {
         $this->_schemaTool->createSchema(array($this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC742User'), $this->_em->getClassMetadata(__NAMESPACE__ . '\\DDC742Comment')));
     } catch (\Exception $e) {
     }
     // make sure classes will be deserialized from caches
     $this->_em->getMetadataFactory()->setMetadataFor(__NAMESPACE__ . '\\DDC742User', null);
     $this->_em->getMetadataFactory()->setMetadataFor(__NAMESPACE__ . '\\DDC742Comment', null);
 }
開發者ID:pnaq57,項目名稱:zf2demo,代碼行數:25,代碼來源:DDC742Test.php

示例7: clear

 /**
  * Clears all cache records.
  *
  * @return boolean TRUE if cache is cleared FALSE otherwise
  */
 public function clear()
 {
     if (false === $this->_cache->flush()) {
         return $this->_onError('clear');
     }
     return true;
 }
開發者ID:mickaelsteinberg,項目名稱:BackBee,代碼行數:12,代碼來源:AbstractMemcache.php

示例8: run

 public function run($request)
 {
     // Flush memcache
     if (defined('DEVTOOLKIT_USE_MEMCACHED') && DEVTOOLKIT_USE_MEMCACHED) {
         $host = defined('MEMCACHE_HOST') ? MEMCACHE_HOST : 'localhost';
         $port = defined('MEMCACHE_PORT') ? MEMCACHE_PORT : 11211;
         $memcache = new Memcache();
         $connected = $memcache->connect($host, $port);
         if ($connected) {
             echo "Flush memcache<br/>";
             $memcache->flush();
         }
     }
     // Clear file cache
     $folder = TEMP_FOLDER;
     $di = new RecursiveDirectoryIterator($folder, FilesystemIterator::SKIP_DOTS);
     $ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST);
     foreach ($ri as $file) {
         echo "Deleting " . $file . '<br/>';
         if ($file->isFile()) {
             unlink($file);
         }
     }
     echo '<hr>Clear completed!';
 }
開發者ID:lekoala,項目名稱:silverstripe-devtoolkit,代碼行數:25,代碼來源:ClearCacheTask.php

示例9: clear

 /**
  * Clear/flush all cached data.
  *
  * @return bool
  */
 public function clear()
 {
     if ($this->open()) {
         return $this->memcache->flush();
     }
     return false;
 }
開發者ID:nesbert,項目名稱:nobjects,代碼行數:12,代碼來源:Data.php

示例10: defaultAction

 public function defaultAction()
 {
     $memcache = new Memcache();
     $memcache->flush();
     $usuario = new Usuario();
     $daoUsuario = DAOFactory::getUsuarioDAO();
     /** @var $user User */
     $user = UserService::getCurrentUser();
     if (isset($user)) {
         $usuarioBD = $daoUsuario->queryByGoogle($user->getUserId());
         if (!$usuarioBD) {
             // No existe el usuario
             $usuario->google = $user->getUserId();
             $usuario->correo = $user->getEmail();
             $usuario->nombre = $user->getNickname();
             $daoUsuario->insert($usuario);
         } else {
             $usuario = $usuarioBD;
         }
         $_SESSION['logoutUrl'] = UserService::createLogoutUrl('/index/closeSession');
         $_SESSION['usuario'] = $usuario;
         include 'vod/index.php';
     } else {
         $this->login();
     }
 }
開發者ID:roberto-pina,項目名稱:ventana-educativa,代碼行數:26,代碼來源:IndexController.class.php

示例11: flush

 /**
  * @see Cache::flush()
  */
 public function flush()
 {
     if (!$this->is_connected) {
         return false;
     }
     return $this->memcache->flush();
 }
開發者ID:ecssjapan,項目名稱:guiding-you-afteropen,代碼行數:10,代碼來源:CacheMemcache.php

示例12: flush

 /**
  * Flush all existing items in storage.
  *
  * @return  boolean
  *
  * @since   __DEPLOY_VERSION__
  */
 public function flush()
 {
     if (!$this->lockindex()) {
         return false;
     }
     return static::$_db->flush();
 }
開發者ID:joomla-projects,項目名稱:media-manager-improvement,代碼行數:14,代碼來源:memcache.php

示例13: GC

 /**
  * @param int $iTimeToClearInHours = 24
  * 
  * @return bool
  */
 public function GC($iTimeToClearInHours = 24)
 {
     if (0 === $iTimeToClearInHours && $this->oMem) {
         return $this->oMem->flush();
     }
     return false;
 }
開發者ID:BertLasker,項目名稱:Catch-design,代碼行數:12,代碼來源:Memcache.php

示例14: flush

 public function flush()
 {
     if (!isset($this->memcache)) {
         $this->connect();
     }
     return $this->memcache->flush();
 }
開發者ID:janpoem,項目名稱:kephp,代碼行數:7,代碼來源:Memcache.php

示例15: clean

 /**
  * Removes items from the cache by conditions & garbage collector.
  * @param  array  conditions
  * @return void
  */
 public function clean(array $conds)
 {
     if (!empty($conds[Cache::ALL])) {
         $this->memcache->flush();
     } elseif (isset($conds[Cache::TAGS]) || isset($conds[Cache::PRIORITY])) {
         throw new NotSupportedException('Tags and priority is not supported by MemcachedStorage.');
     }
 }
開發者ID:romcok,項目名稱:treeview,代碼行數:13,代碼來源:MemcachedStorage.php


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