当前位置: 首页>>代码示例>>PHP>>正文


PHP ConfigurationManager::flushConfigurationCache方法代码示例

本文整理汇总了PHP中TYPO3\Flow\Configuration\ConfigurationManager::flushConfigurationCache方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigurationManager::flushConfigurationCache方法的具体用法?PHP ConfigurationManager::flushConfigurationCache怎么用?PHP ConfigurationManager::flushConfigurationCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\Flow\Configuration\ConfigurationManager的用法示例。


在下文中一共展示了ConfigurationManager::flushConfigurationCache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateAction

 /**
  * Update global Piwik settings
  *
  * @param array $piwik
  * @return void
  */
 public function updateAction(array $piwik)
 {
     $configurationPath = $this->packageManager->getPackage('Portachtzig.Neos.Piwik')->getConfigurationPath();
     $settings = $this->configurationSource->load($configurationPath . ConfigurationManager::CONFIGURATION_TYPE_SETTINGS);
     $piwik['host'] = preg_replace("(^https?://)", "", $piwik['host']);
     $settings = Arrays::setValueByPath($settings, 'Portachtzig.Neos.Piwik.host', $piwik['host']);
     $settings = Arrays::setValueByPath($settings, 'Portachtzig.Neos.Piwik.protocol', $piwik['protocol']);
     $settings = Arrays::setValueByPath($settings, 'Portachtzig.Neos.Piwik.token_auth', $piwik['token_auth']);
     if (array_key_exists('idSite', $piwik)) {
         $settings = Arrays::setValueByPath($settings, 'Portachtzig.Neos.Piwik.idSite', $piwik['idSite']);
     }
     $this->configurationSource->save($configurationPath . ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, $settings);
     $this->configurationManager->flushConfigurationCache();
     $this->redirect('index');
 }
开发者ID:portachtzig,项目名称:neos-piwik,代码行数:21,代码来源:PiwikController.php

示例2: flushConfigurationCachesByChangedFiles

 /**
  * Flushes caches as needed if settings, routes or policies have changed
  *
  * @param array $changedFiles A list of full paths to changed files
  * @return void
  * @see flushSystemCachesByChangedFiles()
  */
 protected function flushConfigurationCachesByChangedFiles(array $changedFiles)
 {
     $aopProxyClassRebuildIsNeeded = FALSE;
     $aopProxyClassInfluencers = '/(?:Policy|Objects|Settings)(?:\\..*)*\\.yaml/';
     $objectClassesCache = $this->getCache('Flow_Object_Classes');
     $objectConfigurationCache = $this->getCache('Flow_Object_Configuration');
     $caches = array('/Policy\\.yaml/' => array('Flow_Security_Authorization_Privilege_Method', 'Flow_Persistence_Doctrine', 'Flow_Persistence_Doctrine_Results', 'Flow_Aop_RuntimeExpressions'), '/Routes([^\\/]*)\\.yaml/' => array('Flow_Mvc_Routing_Route', 'Flow_Mvc_Routing_Resolve'), '/Views\\.yaml/' => array('Flow_Mvc_ViewConfigurations'));
     $cachesToFlush = array();
     foreach (array_keys($changedFiles) as $pathAndFilename) {
         foreach ($caches as $cacheFilePattern => $cacheNames) {
             if (preg_match($aopProxyClassInfluencers, $pathAndFilename) === 1) {
                 $aopProxyClassRebuildIsNeeded = TRUE;
             }
             if (preg_match($cacheFilePattern, $pathAndFilename) !== 1) {
                 continue;
             }
             foreach ($caches[$cacheFilePattern] as $cacheName) {
                 $cachesToFlush[$cacheName] = $cacheFilePattern;
             }
         }
     }
     foreach ($cachesToFlush as $cacheName => $cacheFilePattern) {
         $this->systemLogger->log(sprintf('A configuration file matching the pattern "%s" has been changed, flushing related cache "%s"', $cacheFilePattern, $cacheName), LOG_INFO);
         $this->getCache($cacheName)->flush();
     }
     $this->systemLogger->log('A configuration file has been changed, flushing compiled configuration cache', LOG_INFO);
     $this->configurationManager->flushConfigurationCache();
     if ($aopProxyClassRebuildIsNeeded) {
         $this->systemLogger->log('The configuration has changed, triggering an AOP proxy class rebuild.', LOG_INFO);
         $objectConfigurationCache->remove('allAspectClassesUpToDate');
         $objectConfigurationCache->remove('allCompiledCodeUpToDate');
         $objectClassesCache->flush();
     }
 }
开发者ID:nlx-sascha,项目名称:flow-development-collection,代码行数:41,代码来源:CacheManager.php

示例3: flushCaches

 /**
  * Flushes all registered caches
  *
  * @return void
  * @api
  */
 public function flushCaches()
 {
     $this->createAllCaches();
     foreach ($this->caches as $cache) {
         $cache->flush();
     }
     $this->configurationManager->flushConfigurationCache();
 }
开发者ID:sokunthearith,项目名称:Intern-Project-Week-2,代码行数:14,代码来源:CacheManager.php


注:本文中的TYPO3\Flow\Configuration\ConfigurationManager::flushConfigurationCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。