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


PHP Zend_Cache_Core::clean方法代碼示例

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


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

示例1: execute

 /**
  * Should handle execution of the task, taking as much (optional) parameters as needed
  *
  * The parameters should be optional and failing to provide them should be handled by
  * the task
  */
 public function execute($text = null)
 {
     if ($this->cache instanceof \Zend_Cache_Core) {
         $this->cache->clean(\Zend_Cache::CLEANING_MODE_ALL);
         $this->getBatch()->addMessage($this->_('Cache cleaned'));
     }
 }
開發者ID:harmslijper,項目名稱:gemstracker-library,代碼行數:13,代碼來源:CleanCache.php

示例2: testClean

 public function testClean()
 {
     $this->rediska->set('test', array('aaa', time(), null));
     $reply = $this->cache->clean();
     $this->assertTrue($reply);
     $reply = $this->rediska->get('test');
     $this->assertNull($reply);
 }
開發者ID:utachkin,項目名稱:Rediska,代碼行數:8,代碼來源:Cache.php

示例3: clean

 /**
  * {@inheritdoc}
  *
  * @throws \InvalidArgumentException Exception is thrown when non-supported cleaning mode is specified
  */
 public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, array $tags = [])
 {
     // Cleaning modes 'old' and 'notMatchingTag' are prohibited as a trade off for decoration reliability
     if (!in_array($mode, [\Zend_Cache::CLEANING_MODE_ALL, \Zend_Cache::CLEANING_MODE_MATCHING_TAG, \Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG])) {
         throw new \InvalidArgumentException("Magento cache frontend does not support the cleaning mode '{$mode}'.");
     }
     return $this->_frontend->clean($mode, $this->_unifyIds($tags));
 }
開發者ID:IlyaGluschenko,項目名稱:test001,代碼行數:13,代碼來源:Zend.php

示例4: clean

 /**
  * Remove cache matching id, prefix or tags
  * @param string $cacheId cache id to remove
  * @param string $cachePrefix cache prefix to remove
  * @param array $tags array of cache tags to remove
  */
 public function clean($cacheId = '', $cachePrefix = '', $tags = array())
 {
     $tags = $this->_sanitizeTags($tags);
     $this->_cache->clean(Zend_Cache::CLEANING_MODE_OLD);
     if (!$cachePrefix && !$cacheId) {
         if (is_array($tags) && !empty($tags)) {
             $this->_cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, $tags);
         } else {
             $this->_cache->clean(Zend_Cache::CLEANING_MODE_ALL);
         }
     } else {
         $cacheId = $this->_makeCacheId($cacheId, $cachePrefix);
         $this->_cache->remove($cacheId);
     }
 }
開發者ID:PavloKovalov,項目名稱:seotoaster,代碼行數:21,代碼來源:Cache.php

示例5: afterFormValidationFor

 /**
  * Overrule this function for any activities you want to take place
  * after the form has successfully been validated, but before any
  * buttons are processed.
  *
  * @param int $step The current step
  */
 protected function afterFormValidationFor($step)
 {
     if (3 == $step) {
         $import = $this->loadImportData();
         $model = $this->getModel();
         $saves = array();
         foreach ($model->getCol('exportCode') as $name => $exportCode) {
             if (isset($this->formData[$name]) && $this->formData[$name]) {
                 $saves[] = array('gsu_id_survey' => $this->formData[$name], 'gsu_export_code' => $exportCode);
                 $import['surveyCodes'][$exportCode] = $this->formData[$name];
             }
         }
         if ($saves) {
             $sModel = new \MUtil_Model_TableModel('gems__surveys');
             \Gems_Model::setChangeFieldsByPrefix($sModel, 'gus', $this->currentUser->getUserId());
             $sModel->saveAll($saves);
             $count = $sModel->getChanged();
             if ($count == 0) {
                 $this->addMessage($this->_('No export code changed'));
             } else {
                 $this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('surveys'));
                 $this->addMessage(sprintf($this->plural('%d export code changed', '%d export codes changed', $count), $count));
             }
         }
     }
 }
開發者ID:harmslijper,項目名稱:gemstracker-library,代碼行數:33,代碼來源:ImportTrackSnippetAbstract.php

示例6: _prepareAcl

 /**
  * @return controlar
  */
 private function _prepareAcl()
 {
     if (!is_null($this->usuario) && !is_null($this->usuario->ID_UNIDADE)) {
         // atualizar informações da unidade do usuário na sessão
         // com as informações do banco, a menos que o usuário tenha trocado
         // Testar a existência de um cache de acl para o usuário
         if (!$this->cache->test('acl_' . $this->usuario->ID)) {
             $this->acl = AclFactory::createAcl($this->usuario);
             $this->cache->save($this->acl, 'acl_' . $this->usuario->ID, array('acl_usuario_' . $this->usuario->ID, 'acl_unidade_' . $this->usuario->ID_UNIDADE));
         } else {
             $this->acl = $this->cache->load('acl_' . $this->usuario->ID);
             if ($this->usuario->ID_UNIDADE != $this->acl->getIdUnidade()) {
                 if (!$this->acl->isTrocouUnidade() && !$this->usuario->TROCOU) {
                     // id do cache e da session não batem, e usuário não trocou de unidade
                     // limpar o cache e recriá-lo
                     $this->cache->remove('acl_' . $this->usuario->ID);
                     $this->cache->clean('matchingAnyTag', array('acl_usuario_' . $this->usuario->ID));
                     $this->acl = AclFactory::createAcl($this->usuario);
                     $this->cache->save($this->acl, 'acl_' . $this->usuario->ID, array('acl_usuario_' . $this->usuario->ID, 'acl_unidade_' . $this->usuario->ID_UNIDADE));
                     // limpar
                 }
             }
             $this->usuario = $this->acl->updateSession();
         }
         // Forçar permissão de troca de unidades pro usuário que já trocou de unidade
         if ($this->acl->isTrocouUnidade()) {
             $this->acl->allow($this->usuario->ID, 115);
         }
     }
     return $this;
 }
開發者ID:roquebrasilia,項目名稱:sgdoc-codigo,代碼行數:34,代碼來源:Controlador.php

示例7: resetCache

 /**
  * 重置緩存對象
  * 
  * @static
  * @return boolean 
  */
 public static function resetCache()
 {
     if (null !== self::$_cache) {
         return self::$_cache->clean();
     }
     return false;
 }
開發者ID:starflash,項目名稱:ZtChart-ZF1-Example,代碼行數:13,代碼來源:Loader.php

示例8: flush

 /**
  * Clean cached data by specific tag
  *
  * @return bool
  */
 public function flush()
 {
     Magento_Profiler::start('cache_flush', $this->_generateProfilerTags('flush'));
     $res = $this->_frontend->clean();
     Magento_Profiler::stop('cache_flush');
     return $res;
 }
開發者ID:natxetee,項目名稱:magento2,代碼行數:12,代碼來源:Cache.php

示例9: testCleanAnyMatchingTag

 /**
  * @group tags
  */
 public function testCleanAnyMatchingTag()
 {
     $this->setKeys();
     $this->cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('tag_a1', 'tag_a3'));
     $ids = $this->cache->getIds();
     sort($ids);
     $this->assertEquals(array('test_ccc'), $ids);
 }
開發者ID:r-kovalenko,項目名稱:Rediska,代碼行數:11,代碼來源:CacheTest.php

示例10: clearCache

 /**
  * Clears all set cache data
  *
  * @return void
  */
 public static function clearCache()
 {
     if (self::$_cacheTags) {
         self::$_cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array('Zend_Locale'));
     } else {
         self::$_cache->clean(Zend_Cache::CLEANING_MODE_ALL);
     }
 }
開發者ID:grlf,項目名稱:eyedock,代碼行數:13,代碼來源:Data.php

示例11: afterSave

 /**
  * Hook that allows actions when data was saved
  *
  * When not rerouted, the form will be populated afterwards
  *
  * @param int $changed The number of changed rows (0 or 1 usually, but can be more)
  */
 protected function afterSave($changed)
 {
     if ($changed) {
         // Clean cache on changes
         if ($this->cacheTags && $this->cache instanceof \Zend_Cache_Core) {
             $this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, (array) $this->cacheTags);
         }
     }
 }
開發者ID:GemsTracker,項目名稱:MUtil,代碼行數:16,代碼來源:FormSnippetAbstract.php

示例12: clean

 /**
  * Clear event - clear all cache by tags
  * 
  * @param Zend_EventManager_EventDescription $event
  */
 public function clean(\Zend_EventManager_EventDescription $event)
 {
     $params = $event->getParams();
     $mode = \Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG;
     if (isset($params['mode'])) {
         $mode = $params['mode'];
     }
     return $this->cache->clean($mode, $this->_getTags($event));
 }
開發者ID:lciolecki,項目名稱:zf-extensions-library,代碼行數:14,代碼來源:CacheListener.php

示例13: clearConfigCache

 /**
  * Clear search cache
  */
 public function clearConfigCache()
 {
     $capabilities = $this->cache->getBackend()->getCapabilities();
     if (!empty($capabilities['tags'])) {
         $this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('Shopware_Config', 'Shopware_Plugin'));
     } else {
         $this->cache->clean();
     }
 }
開發者ID:Goucher,項目名稱:shopware,代碼行數:12,代碼來源:CacheManager.php

示例14: performAction

 /**
  * Overrule this function if you want to perform a different
  * action than deleting when the user choose 'yes'.
  */
 protected function performAction()
 {
     $model = $this->getModel();
     $model->save($this->saveData + $model->getFilter());
     if ($this->cacheTags && $this->cache instanceof \Zend_Cache_Core) {
         $this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, (array) $this->cacheTags);
     }
     $this->setAfterDeleteRoute();
 }
開發者ID:GemsTracker,項目名稱:MUtil,代碼行數:13,代碼來源:ModelConfirmDataChangeSnippetAbstract.php

示例15: afterSave

 /**
  * Hook that allows actions when data was saved
  *
  * When not rerouted, the form will be populated afterwards
  *
  * @param int $changed The number of changed rows (0 or 1 usually, but can be more)
  */
 protected function afterSave($changed)
 {
     if ($this->trackEngine) {
         $this->addMessage($this->_('Track merge finished'));
     } else {
         $this->addMessage($this->_('Track import finished'));
     }
     $this->cache->clean(\Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, array('tracks'));
 }
開發者ID:GemsTracker,項目名稱:gemstracker-library,代碼行數:16,代碼來源:ImportTrackSnippetAbstract.php


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