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


PHP Zend_Cache_Backend::clean方法代碼示例

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


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

示例1: clean

 /**
  * Clean some cache records
  *
  * Available modes are :
  * Zend_Cache::CLEANING_MODE_ALL (default)    => remove all cache entries ($tags is not used)
  * Zend_Cache::CLEANING_MODE_OLD              => remove too old cache entries ($tags is not used)
  * Zend_Cache::CLEANING_MODE_MATCHING_TAG     => remove cache entries matching all given tags
  *                                               ($tags can be an array of strings or a single string)
  * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
  *                                               ($tags can be an array of strings or a single string)
  *
  * @param  string $mode Clean mode
  * @param  array  $tags Array of tags
  * @return boolean true if no problem
  */
 public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
 {
     switch ($mode) {
         case Zend_Cache::CLEANING_MODE_ALL:
             $boolFast = $this->_fastBackend->clean(Zend_Cache::CLEANING_MODE_ALL);
             $boolSlow = $this->_slowBackend->clean(Zend_Cache::CLEANING_MODE_ALL);
             return $boolFast && $boolSlow;
             break;
         case Zend_Cache::CLEANING_MODE_OLD:
             return $this->_slowBackend->clean(Zend_Cache::CLEANING_MODE_OLD);
         case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
             $ids = $this->_slowBackend->getIdsMatchingTags($tags);
             $res = true;
             foreach ($ids as $id) {
                 $res = $res && $this->_slowBackend->remove($id) && $this->_fastBackend->remove($id);
             }
             return $res;
             break;
         case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
             $ids = $this->_slowBackend->getIdsNotMatchingTags($tags);
             $res = true;
             foreach ($ids as $id) {
                 $res = $res && $this->_slowBackend->remove($id) && $this->_fastBackend->remove($id);
             }
             return $res;
             break;
         default:
             Zend_Cache::throwException('Invalid mode for clean() method');
             break;
     }
 }
開發者ID:uester,項目名稱:escolaonline,代碼行數:46,代碼來源:TwoLevels.php

示例2: Clean

 /**
  * Чистит кеши
  *
  * @param int $cMode	Режим очистки кеша
  * @param array $aTags	Список тегов, актуально для режима Zend_Cache::CLEANING_MODE_MATCHING_TAG
  * @return bool
  */
 public function Clean($cMode = Zend_Cache::CLEANING_MODE_ALL, $aTags = array())
 {
     if (!$this->bUseCache) {
         return false;
     }
     return $this->oBackendCache->clean($cMode, $aTags);
 }
開發者ID:lunavod,項目名稱:bunker_stable,代碼行數:14,代碼來源:Cache.class.php

示例3: clean

 /**
  * Clean some cache records
  *
  * Available modes are :
  * \Zend_Cache::CLEANING_MODE_ALL (default)    => remove all cache entries ($tags is not used)
  * \Zend_Cache::CLEANING_MODE_OLD              => remove too old cache entries ($tags is not used)
  * \Zend_Cache::CLEANING_MODE_MATCHING_TAG     => remove cache entries matching all given tags
  *                                               ($tags can be an array of strings or a single string)
  * \Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
  *                                               ($tags can be an array of strings or a single string)
  * \Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
  *                                               ($tags can be an array of strings or a single string)
  *
  * @param  string $mode Clean mode
  * @param  string[] $tags Array of tags
  * @return bool true if no problem
  */
 public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, $tags = [])
 {
     return $this->_backend->clean($mode, $tags);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:21,代碼來源:AbstractDecorator.php


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