[TASK] Remove extList from LocalConfiguration
authorChristian Kuhn <lolli@schwarzbu.ch>
Mon, 19 Nov 2012 12:50:38 +0000 (13:50 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 19 Nov 2012 14:12:23 +0000 (15:12 +0100)
extList was kept next to the new extListArray in LocalConfiguration.
Both hold the current list of loaded extensions. This leads to
confusion which variable is the one that takes precedence.
The patch removes extList from the upgrade wizard in the install tool
and only writes extListArray. This way, only one key is kept in
LocalConfiguration.php. For compatibility reasons, the array entry
'extList' is added to $GLOBALS['TYPO3_CONF_VARS'] at runtime during
bootstrap.

Change-Id: I6102b2b4da9761c86189ae3f73ad3a423715e037
Resolves: #43094
Releases: 6.0
Reviewed-on: http://review.typo3.org/16566
Reviewed-by: Helmut Hummel
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Wouter Wolters
t3lib/stddb/DefaultConfiguration.php
typo3/sysext/core/Classes/Configuration/ConfigurationManager.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php
typo3/sysext/install/Classes/CoreUpdates/LocalConfigurationUpdate.php

index f5546c3..2caaf67 100644 (file)
@@ -216,7 +216,6 @@ return array(
                'requiredExt' => array(),               // String. List of additional extensions which are REQUIRED and cannot be unloaded by the Extension Manager!
                'excludeForPackaging' => '(CVS|\\..*|.*~|.*\\.bak)',            // String: List of directories and files which will not be packaged into extensions nor taken into account otherwise by the Extension Manager. Perl regular expression syntax!
                'extCache' => -1,               // <p>Integer (0, 1)</p><dl><dt>0</dt><dd>ext-scripts (ext_localconf.php and ext_tables.php) are NOT cached, but included every time</dd><dt>1</dt><dd>scripts cached to typo3conf/temp_CACHED_[sitePathHash]* (saves some milliseconds even with PHP accelerators)</dd></dl>
                'requiredExt' => array(),               // String. List of additional extensions which are REQUIRED and cannot be unloaded by the Extension Manager!
                'excludeForPackaging' => '(CVS|\\..*|.*~|.*\\.bak)',            // String: List of directories and files which will not be packaged into extensions nor taken into account otherwise by the Extension Manager. Perl regular expression syntax!
                'extCache' => -1,               // <p>Integer (0, 1)</p><dl><dt>0</dt><dd>ext-scripts (ext_localconf.php and ext_tables.php) are NOT cached, but included every time</dd><dt>1</dt><dd>scripts cached to typo3conf/temp_CACHED_[sitePathHash]* (saves some milliseconds even with PHP accelerators)</dd></dl>
-               'extList' => 'filelist,version,tsconfig_help,context_help,extra_page_cm_options,impexp,belog,about,cshmanual,aboutmodules,setup,opendocs,install,t3editor,felogin,feedit,recycler',
                'extListArray' => array(
                        'filelist',
                        'version',
                'extListArray' => array(
                        'filelist',
                        'version',
index 1dd14c3..0e764ee 100644 (file)
@@ -42,18 +42,22 @@ class ConfigurationManager implements \TYPO3\CMS\Core\SingletonInterface {
         * Path to default TYPO3_CONF_VARS file, relative to PATH_site
         */
        const DEFAULT_CONFIGURATION_FILE = 't3lib/stddb/DefaultConfiguration.php';
         * Path to default TYPO3_CONF_VARS file, relative to PATH_site
         */
        const DEFAULT_CONFIGURATION_FILE = 't3lib/stddb/DefaultConfiguration.php';
+
        /**
         * Path to local overload TYPO3_CONF_VARS file, relative to PATH_site
         */
        const LOCAL_CONFIGURATION_FILE = 'typo3conf/LocalConfiguration.php';
        /**
         * Path to local overload TYPO3_CONF_VARS file, relative to PATH_site
         */
        const LOCAL_CONFIGURATION_FILE = 'typo3conf/LocalConfiguration.php';
+
        /**
         * Path to additional local file, relative to PATH_site
         */
        const ADDITIONAL_CONFIGURATION_FILE = 'typo3conf/AdditionalConfiguration.php';
        /**
         * Path to additional local file, relative to PATH_site
         */
        const ADDITIONAL_CONFIGURATION_FILE = 'typo3conf/AdditionalConfiguration.php';
+
        /**
         * Path to legacy localconf.php file, relative to PATH_site
         */
        const LOCALCONF_FILE = 'typo3conf/localconf.php';
        /**
         * Path to legacy localconf.php file, relative to PATH_site
         */
        const LOCALCONF_FILE = 'typo3conf/localconf.php';
+
        /**
         * Writing to these configuration pathes is always allowed,
         * even if the requested sub path does not exist yet.
        /**
         * Writing to these configuration pathes is always allowed,
         * even if the requested sub path does not exist yet.
@@ -227,6 +231,8 @@ class ConfigurationManager implements \TYPO3\CMS\Core\SingletonInterface {
                        if (@is_file((PATH_site . self::ADDITIONAL_CONFIGURATION_FILE))) {
                                require PATH_site . self::ADDITIONAL_CONFIGURATION_FILE;
                        }
                        if (@is_file((PATH_site . self::ADDITIONAL_CONFIGURATION_FILE))) {
                                require PATH_site . self::ADDITIONAL_CONFIGURATION_FILE;
                        }
+                       // @deprecated since 6.0: Simulate old 'extList' as comma separated list of 'extListArray'
+                       $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'] = implode(',', $GLOBALS['TYPO3_CONF_VARS']['EXT']['extListArray']);
                } elseif (@is_file((PATH_site . self::LOCALCONF_FILE))) {
                        $GLOBALS['TYPO3_CONF_VARS'] = $this->getDefaultConfiguration();
                        // Legacy localconf.php handling
                } elseif (@is_file((PATH_site . self::LOCALCONF_FILE))) {
                        $GLOBALS['TYPO3_CONF_VARS'] = $this->getDefaultConfiguration();
                        // Legacy localconf.php handling
index 5998ab8..04e2834 100644 (file)
@@ -1891,6 +1891,7 @@ tt_content.' . $key . $prefix . ' {
                        $loadedExtensions = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extListArray'];
                } else {
                        // Fallback handling if extlist is still a string and not an array
                        $loadedExtensions = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extListArray'];
                } else {
                        // Fallback handling if extlist is still a string and not an array
+                       // @deprecated since 6.0, will be removed in 6.2
                        $loadedExtensions = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList']);
                }
                // Add required extensions
                        $loadedExtensions = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList']);
                }
                // Add required extensions
@@ -1970,9 +1971,6 @@ tt_content.' . $key . $prefix . ' {
        static public function writeNewExtensionList(array $newExtensionList) {
                $extensionList = array_unique($newExtensionList);
                \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->setLocalConfigurationValueByPath('EXT/extListArray', $extensionList);
        static public function writeNewExtensionList(array $newExtensionList) {
                $extensionList = array_unique($newExtensionList);
                \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->setLocalConfigurationValueByPath('EXT/extListArray', $extensionList);
-               // @deprecated: extList as string is deprecated, the handling will be removed with 6.2
-               // For now, this value is still set for better backwards compatibility
-               \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->setLocalConfigurationValueByPath('EXT/extList', implode(',', $extensionList));
                static::removeCacheFiles();
        }
 
                static::removeCacheFiles();
        }
 
index 4f8ca2c..4d45dbc 100644 (file)
@@ -273,8 +273,8 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
                \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::removeCacheFiles();
                // Set new extlist / extlistArray for extension load changes at runtime
                $localConfiguration = $this->configurationManager->getLocalConfiguration();
                \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::removeCacheFiles();
                // Set new extlist / extlistArray for extension load changes at runtime
                $localConfiguration = $this->configurationManager->getLocalConfiguration();
-               $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'] = $localConfiguration['EXT']['extList'];
                $GLOBALS['TYPO3_CONF_VARS']['EXT']['extListArray'] = $localConfiguration['EXT']['extListArray'];
                $GLOBALS['TYPO3_CONF_VARS']['EXT']['extListArray'] = $localConfiguration['EXT']['extListArray'];
+               $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'] = implode(',', $GLOBALS['TYPO3_CONF_VARS']['EXT']['extListArray']);
                \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->populateTypo3LoadedExtGlobal(FALSE)->loadAdditionalConfigurationFromExtensions(FALSE);
        }
 
                \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->populateTypo3LoadedExtGlobal(FALSE)->loadAdditionalConfigurationFromExtensions(FALSE);
        }
 
index 8404998..a440213 100644 (file)
@@ -79,7 +79,6 @@ class LocalConfigurationUpdate extends \TYPO3\CMS\Install\Updates\AbstractUpdate
                                if (preg_match('/^\\$TYPO3_CONF_VARS\\[\'EXT\'\\]\\[\'extList\'\\] *={1} *\'(.+)\';{1}/', $line, $matches) === 1) {
                                        $extListAsArray = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $matches[1], TRUE);
                                        $typo3ConfigurationVariables[] = '$TYPO3_CONF_VARS[\'EXT\'][\'extListArray\'] = ' . var_export($extListAsArray, TRUE) . ';';
                                if (preg_match('/^\\$TYPO3_CONF_VARS\\[\'EXT\'\\]\\[\'extList\'\\] *={1} *\'(.+)\';{1}/', $line, $matches) === 1) {
                                        $extListAsArray = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $matches[1], TRUE);
                                        $typo3ConfigurationVariables[] = '$TYPO3_CONF_VARS[\'EXT\'][\'extListArray\'] = ' . var_export($extListAsArray, TRUE) . ';';
-                                       $typo3ConfigurationVariables[] = '$TYPO3_CONF_VARS[\'EXT\'][\'extList\'] = \'' . $matches[1] . '\';';
                                } elseif (preg_match('/^\\$TYPO3_CONF_VARS.+;{1}/', $line, $matches) === 1) {
                                        $typo3ConfigurationVariables[] = $matches[0];
                                } elseif (preg_match('/^\\$typo_db.+;{1}/', $line, $matches) === 1) {
                                } elseif (preg_match('/^\\$TYPO3_CONF_VARS.+;{1}/', $line, $matches) === 1) {
                                        $typo3ConfigurationVariables[] = $matches[0];
                                } elseif (preg_match('/^\\$typo_db.+;{1}/', $line, $matches) === 1) {