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