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