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


PHP ExtensionManager::removeCacheFiles方法代码示例

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


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

示例1: writeExtensionTypoScriptStyleConfigurationToLocalconf

 /**
  * Writes the TSstyleconf values to "localconf.php"
  * Removes the temp_CACHED* files before return.
  *
  * @param string $extensionKey Extension key
  * @param array $newConfiguration Configuration array to write back
  * @return void
  */
 public function writeExtensionTypoScriptStyleConfigurationToLocalconf($extensionKey, $newConfiguration)
 {
     \TYPO3\CMS\Core\Configuration\ConfigurationManager::setLocalConfigurationValueByPath('EXT/extConf/' . $extensionKey, serialize($newConfiguration));
     \TYPO3\CMS\Core\Extension\ExtensionManager::removeCacheFiles();
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:13,代码来源:InstallUtility.php

示例2: clear_cacheCmd

 /**
  * Clears the cache based on the command $cacheCmd.
  *
  * $cacheCmd='pages':	Clears cache for all pages. Requires admin-flag to
  * be set for BE_USER.
  *
  * $cacheCmd='all':		Clears all cache_tables. This is necessary if
  * templates are updated. Requires admin-flag to be set for BE_USER.
  *
  * $cacheCmd=[integer]:	Clears cache for the page pointed to by $cacheCmd
  * (an integer).
  *
  * $cacheCmd='cacheTag:[string]':  Flush page and pagesection cache by given tag
  *
  * $cacheCmd='cacheId:[string]':  Removes cache identifier from page and page section cache
  *
  * Can call a list of post processing functions as defined in
  * $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc']
  * (numeric array with values being the function references, called by
  * t3lib_div::callUserFunction()).
  *
  * Note: The following cache_* are intentionally not cleared by
  * $cacheCmd='all':
  *
  * - cache_md5params:	RDCT redirects.
  * - cache_imagesizes:	Clearing this table would cause a lot of unneeded
  * Imagemagick calls because the size informations have
  * to be fetched again after clearing.
  *
  * @param string $cacheCmd The cache command, see above description
  * @return void
  */
 public function clear_cacheCmd($cacheCmd)
 {
     if (is_object($this->BE_USER)) {
         $this->BE_USER->writelog(3, 1, 0, 0, 'User %s has cleared the cache (cacheCmd=%s)', array($this->BE_USER->user['username'], $cacheCmd));
     }
     // Clear cache for either ALL pages or ALL tables!
     switch (strtolower($cacheCmd)) {
         case 'pages':
             if ($this->admin || $this->BE_USER->getTSConfigVal('options.clearCache.pages')) {
                 $this->internal_clearPageCache();
             }
             break;
         case 'all':
             if ($this->admin || $this->BE_USER->getTSConfigVal('options.clearCache.all')) {
                 // Clear all caching framework caches
                 $GLOBALS['typo3CacheManager']->flushCaches();
                 if (\TYPO3\CMS\Core\Extension\ExtensionManager::isLoaded('cms')) {
                     $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery('cache_treelist');
                 }
                 // Clearing additional cache tables:
                 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearAllCache_additionalTables'])) {
                     foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearAllCache_additionalTables'] as $tableName) {
                         if (!preg_match('/[^[:alnum:]_]/', $tableName) && substr($tableName, -5) === 'cache') {
                             $GLOBALS['TYPO3_DB']->exec_TRUNCATEquery($tableName);
                         } else {
                             throw new \RuntimeException('TYPO3 Fatal Error: Trying to flush table "' . $tableName . '" with "Clear All Cache"', 1270853922);
                         }
                     }
                 }
             }
             \TYPO3\CMS\Core\Extension\ExtensionManager::removeCacheFiles();
             break;
         case 'temp_cached':
             \TYPO3\CMS\Core\Extension\ExtensionManager::removeCacheFiles();
             break;
     }
     $tagsToFlush = array();
     // Clear cache for a page ID!
     if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($cacheCmd)) {
         if (\TYPO3\CMS\Core\Extension\ExtensionManager::isLoaded('cms')) {
             $list_cache = array($cacheCmd);
             // Call pre-processing function for clearing of cache for page ids:
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'])) {
                 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearPageCacheEval'] as $funcName) {
                     $_params = array('pageIdArray' => &$list_cache, 'cacheCmd' => $cacheCmd, 'functionID' => 'clear_cacheCmd()');
                     // Returns the array of ids to clear, FALSE if nothing should be cleared! Never an empty array!
                     \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcName, $_params, $this);
                 }
             }
             // Delete cache for selected pages:
             if (is_array($list_cache)) {
                 foreach ($list_cache as $pageId) {
                     $tagsToFlush[] = 'pageId_' . (int) $pageId;
                 }
             }
         }
     }
     // flush cache by tag
     if (\TYPO3\CMS\Core\Utility\GeneralUtility::isFirstPartOfStr(strtolower($cacheCmd), 'cachetag:')) {
         $cacheTag = substr($cacheCmd, 9);
         $tagsToFlush[] = $cacheTag;
     }
     // process caching framwork operations
     if (count($tagsToFlush) > 0) {
         /** @var $pageCache \TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend */
         $pageCache = $GLOBALS['typo3CacheManager']->getCache('cache_pages');
         /** @var $pageSectionCache \TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend */
         $pageSectionCache = $GLOBALS['typo3CacheManager']->getCache('cache_pagesection');
//.........这里部分代码省略.........
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:101,代码来源:DataHandler.php

示例3: updateWizard

 /**
  * Generates update wizard
  *
  * @return void
  * @todo Define visibility
  */
 public function updateWizard()
 {
     \TYPO3\CMS\Core\Extension\ExtensionManager::removeCacheFiles();
     // Forces creation / update of caching framework tables that are needed by some update wizards
     $cacheTablesConfiguration = implode(LF, $this->sqlHandler->getStatementArray(\TYPO3\CMS\Core\Cache\Cache::getDatabaseTableDefinitions(), 1, '^CREATE TABLE '));
     $neededTableDefinition = $this->sqlHandler->getFieldDefinitions_fileContent($cacheTablesConfiguration);
     $currentTableDefinition = $this->sqlHandler->getFieldDefinitions_database();
     $updateTableDefenition = $this->sqlHandler->getDatabaseExtra($neededTableDefinition, $currentTableDefinition);
     $updateStatements = $this->sqlHandler->getUpdateSuggestions($updateTableDefenition);
     if (isset($updateStatements['create_table']) && count($updateStatements['create_table']) > 0) {
         $this->sqlHandler->performUpdateQueries($updateStatements['create_table'], $updateStatements['create_table']);
     }
     if (isset($updateStatements['add']) && count($updateStatements['add']) > 0) {
         $this->sqlHandler->performUpdateQueries($updateStatements['add'], $updateStatements['add']);
     }
     if (isset($updateStatements['change']) && count($updateStatements['change']) > 0) {
         $this->sqlHandler->performUpdateQueries($updateStatements['change'], $updateStatements['change']);
     }
     // call wizard
     $action = $this->INSTALL['database_type'] ? $this->INSTALL['database_type'] : 'checkForUpdate';
     $this->updateWizard_parts($action);
     $this->output($this->outputWrapper($this->printAll()));
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:29,代码来源:Installer.php

示例4: removeCacheFilesFlushesCache

 /**
  * @test
  */
 public function removeCacheFilesFlushesCache()
 {
     $mockCache = $this->getMock('TYPO3\\CMS\\Core\\Cache\\Frontend\\AbstractFrontend', array('getIdentifier', 'set', 'get', 'getByTag', 'has', 'remove', 'flush', 'flushByTag', 'requireOnce'), array(), '', FALSE);
     $GLOBALS['typo3CacheManager'] = $this->getMock('TYPO3\\CMS\\Core\\Cache\\CacheManager', array('getCache'));
     $GLOBALS['typo3CacheManager']->expects($this->any())->method('getCache')->will($this->returnValue($mockCache));
     $mockCache->expects($this->once())->method('flush');
     \TYPO3\CMS\Core\Extension\ExtensionManager::removeCacheFiles();
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:11,代码来源:ExtensionManagerTest.php


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