[BUGFIX] Install Tool: Avoid caching 83/39283/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 5 May 2015 17:11:07 +0000 (19:11 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 6 May 2015 07:34:12 +0000 (09:34 +0200)
Install Tool bootstrap initializes the cache system and sets
all caches to NullBackend for increased stability of the tool.
Install Tool submodules however, that later call a bootstrap method
to additionally load ext_tables and friends for some scenarios,
indirectly call a method to set caches to the default values
without NullBackend again. As result, Fluid views are sometimes
cached again.
The patch supresses this by opening further detail methods of
the Bootstrap and calls them directly without pushing a
cache configuration again.

Resolves: #66809
Releases: master
Change-Id: I64acf470eba939eb7ba246aedb2bbb0fdf83384f
Reviewed-on: http://review.typo3.org/39283
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Tests/FunctionalTestCaseBootstrapUtility.php
typo3/sysext/install/Classes/Controller/Action/AbstractAction.php
typo3/sysext/install/Classes/Service/ClearCacheService.php

index 714e503..a2a6867 100644 (file)
@@ -181,7 +181,10 @@ class Bootstrap {
                        $this->startOutputBuffering()
                                ->loadConfigurationAndInitialize()
                                ->loadTypo3LoadedExtAndExtLocalconf(TRUE)
-                               ->applyAdditionalConfigurationSettings()
+                               ->initializeExceptionHandling()
+                               ->setFinalCachingFrameworkCacheConfiguration()
+                               ->defineLoggingAndExceptionConstants()
+                               ->unsetReservedGlobalVariables()
                                ->initializeTypo3DbGlobal();
                }
 
@@ -497,20 +500,6 @@ class Bootstrap {
        }
 
        /**
-        * Sets up additional configuration applied in all scopes
-        *
-        * @return Bootstrap
-        * @internal This is not a public API method, do not use in own extensions
-        */
-       public function applyAdditionalConfigurationSettings() {
-               $this->initializeExceptionHandling()
-                       ->setFinalCachingFrameworkCacheConfiguration()
-                       ->defineLoggingAndExceptionConstants()
-                       ->unsetReservedGlobalVariables();
-               return $this;
-       }
-
-       /**
         * Throws an exception if no browser could be identified
         *
         * @return Bootstrap
@@ -788,8 +777,9 @@ class Bootstrap {
         * to change the exception and error handler configuration.
         *
         * @return Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
-       protected function initializeExceptionHandling() {
+       public function initializeExceptionHandling() {
                if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['errors']['exceptionHandler'])) {
                        if (!empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['errorHandler'])) {
                                if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['errorHandler'] !== $this->activeErrorHandlerClassName) {
@@ -820,8 +810,9 @@ class Bootstrap {
         * global cache array to the manager again at this point
         *
         * @return Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
-       protected function setFinalCachingFrameworkCacheConfiguration() {
+       public function setFinalCachingFrameworkCacheConfiguration() {
                $this->getEarlyInstance(\TYPO3\CMS\Core\Cache\CacheManager::class)->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
                return $this;
        }
@@ -830,8 +821,9 @@ class Bootstrap {
         * Define logging and exception constants
         *
         * @return Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
-       protected function defineLoggingAndExceptionConstants() {
+       public function defineLoggingAndExceptionConstants() {
                define('TYPO3_DLOG', $GLOBALS['TYPO3_CONF_VARS']['SYS']['enable_DLOG']);
                define('TYPO3_ERROR_DLOG', $GLOBALS['TYPO3_CONF_VARS']['SYS']['enable_errorDLOG']);
                define('TYPO3_EXCEPTION_DLOG', $GLOBALS['TYPO3_CONF_VARS']['SYS']['enable_exceptionDLOG']);
@@ -843,8 +835,9 @@ class Bootstrap {
         * Those are set in "ext:core/ext_tables.php" file:
         *
         * @return Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
-       protected function unsetReservedGlobalVariables() {
+       public function unsetReservedGlobalVariables() {
                unset($GLOBALS['PAGES_TYPES']);
                unset($GLOBALS['TCA']);
                unset($GLOBALS['TBE_MODULES']);
index b671746..fd1c40a 100644 (file)
@@ -433,7 +433,10 @@ class FunctionalTestCaseBootstrapUtility {
                        ->baseSetup('')
                        ->loadConfigurationAndInitialize(TRUE)
                        ->loadTypo3LoadedExtAndExtLocalconf(TRUE)
-                       ->applyAdditionalConfigurationSettings();
+                       ->initializeExceptionHandling()
+                       ->setFinalCachingFrameworkCacheConfiguration()
+                       ->defineLoggingAndExceptionConstants()
+                       ->unsetReservedGlobalVariables();
        }
 
        /**
index 6904a71..6169668 100644 (file)
@@ -247,7 +247,9 @@ abstract class AbstractAction implements ActionInterface {
        protected function loadExtLocalconfDatabaseAndExtTables() {
                \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
                        ->loadTypo3LoadedExtAndExtLocalconf(FALSE)
-                       ->applyAdditionalConfigurationSettings()
+                       ->initializeExceptionHandling()
+                       ->defineLoggingAndExceptionConstants()
+                       ->unsetReservedGlobalVariables()
                        ->initializeTypo3DbGlobal()
                        ->loadExtensionTables(FALSE);
        }
index 2b696a7..653f56b 100644 (file)
@@ -73,7 +73,9 @@ class ClearCacheService {
                // Use bootstrap to load all ext_localconf and ext_tables
                $bootstrap
                        ->loadTypo3LoadedExtAndExtLocalconf(FALSE)
-                       ->applyAdditionalConfigurationSettings()
+                       ->initializeExceptionHandling()
+                       ->defineLoggingAndExceptionConstants()
+                       ->unsetReservedGlobalVariables()
                        ->initializeTypo3DbGlobal()
                        ->loadExtensionTables(FALSE);