From 9f1a4f8c5d248732f640eca73b8f7458dfc84832 Mon Sep 17 00:00:00 2001 From: Matthias Vogel <typo3@kanti.de> Date: Fri, 8 Sep 2017 11:53:16 +0200 Subject: [PATCH] [BUGFIX] Store extension configuration in key EXTENSIONS The previous patch changed it to EXTCONF, but this conflicts with other stuff. Resolves: #82370 Releases: master Change-Id: Ib515a1364f45739fb7f8e0fa3e781099f1c1a107 Reviewed-on: https://review.typo3.org/53999 Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: Benni Mack <benni@typo3.org> --- .../core/Classes/Configuration/ConfigurationManager.php | 1 + typo3/sysext/core/Configuration/DefaultConfiguration.php | 4 ++-- ...on-82254-DeprecateGLOBALSTYPO3_CONF_VARSEXTextConf.rst | 6 +++--- ...ture-82254-StoreExtensionConfigurationAsPlainArray.rst | 4 ++-- .../Classes/Utility/ConfigurationUtility.php | 8 ++++---- .../Tests/Unit/Utility/ConfigurationUtilityTest.php | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/typo3/sysext/core/Classes/Configuration/ConfigurationManager.php b/typo3/sysext/core/Classes/Configuration/ConfigurationManager.php index 4babe106691f..d35541b8d305 100644 --- a/typo3/sysext/core/Classes/Configuration/ConfigurationManager.php +++ b/typo3/sysext/core/Classes/Configuration/ConfigurationManager.php @@ -76,6 +76,7 @@ class ConfigurationManager 'EXTCONF', 'DB', 'SYS/caching/cacheConfigurations', + 'EXTENSIONS', ]; /** diff --git a/typo3/sysext/core/Configuration/DefaultConfiguration.php b/typo3/sysext/core/Configuration/DefaultConfiguration.php index 01b4d1e90818..c9dc2fb2af00 100644 --- a/typo3/sysext/core/Configuration/DefaultConfiguration.php +++ b/typo3/sysext/core/Configuration/DefaultConfiguration.php @@ -16,7 +16,7 @@ * This file contains the default array definition that is * later populated as $GLOBALS['TYPO3_CONF_VARS'] * - * The description of the various options is stored in the DefaultConfigurationDescription.php file + * The description of the various options is stored in the DefaultConfigurationDescription.yaml file */ return [ 'GFX' => [ // Configuration of the image processing features in TYPO3. 'IM' and 'GD' are short for ImageMagick and GD library respectively. @@ -1125,5 +1125,5 @@ return [ 'update' => [], ], ], - 'SVCONF' => [] + 'SVCONF' => [], ]; diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82254-DeprecateGLOBALSTYPO3_CONF_VARSEXTextConf.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82254-DeprecateGLOBALSTYPO3_CONF_VARSEXTextConf.rst index 4ecae44100c2..ee96a3ab7a46 100644 --- a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82254-DeprecateGLOBALSTYPO3_CONF_VARSEXTextConf.rst +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-82254-DeprecateGLOBALSTYPO3_CONF_VARSEXTextConf.rst @@ -9,7 +9,7 @@ See :issue:`82254` Description =========== -The extension configuration stored in $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'] has been deprecated and replaced by a plain array in $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']. +The extension configuration stored in $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'] has been deprecated and replaced by a plain array in $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']. Affected Installations @@ -21,6 +21,6 @@ All extensions manually getting settings and unserializing them from $GLOBALS['T Migration ========= -Switch to the use of $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'] instead and remove all unserialize calls. +Switch to the use of $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'] instead and remove all unserialize calls. -.. index:: LocalConfiguration, PHP-API, FullyScanned \ No newline at end of file +.. index:: LocalConfiguration, PHP-API, FullyScanned diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-82254-StoreExtensionConfigurationAsPlainArray.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-82254-StoreExtensionConfigurationAsPlainArray.rst index 9af5bfb77410..4e12dbd226e4 100644 --- a/typo3/sysext/core/Documentation/Changelog/master/Feature-82254-StoreExtensionConfigurationAsPlainArray.rst +++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-82254-StoreExtensionConfigurationAsPlainArray.rst @@ -11,7 +11,7 @@ Description There is no reason to save the extension configuration as serialized values instead of an plain array. Arrays are easier to handle and there are already parts of the core using arrays (for example the avatar provider registration). -Therefore the API has been changed to store the extension configuration as an array in $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']. The configuration is merged on save with the default configuration and the full configuration is written to LocalConfiguration. +Therefore the API has been changed to store the extension configuration as an array in $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']. The configuration is merged on save with the default configuration and the full configuration is written to LocalConfiguration. Impact @@ -19,4 +19,4 @@ Impact Extension configuration can now be accessed as array directly, without calling unserialize(). The old and new API will co-exist in version 9. -.. index:: LocalConfiguration, PHP-API \ No newline at end of file +.. index:: LocalConfiguration, PHP-API diff --git a/typo3/sysext/extensionmanager/Classes/Utility/ConfigurationUtility.php b/typo3/sysext/extensionmanager/Classes/Utility/ConfigurationUtility.php index d52ae1649dac..1f3600c66886 100644 --- a/typo3/sysext/extensionmanager/Classes/Utility/ConfigurationUtility.php +++ b/typo3/sysext/extensionmanager/Classes/Utility/ConfigurationUtility.php @@ -67,7 +67,7 @@ class ConfigurationUtility implements \TYPO3\CMS\Core\SingletonInterface /** @var $configurationManager \TYPO3\CMS\Core\Configuration\ConfigurationManager */ $configurationManager = $this->objectManager->get(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class); $configurationManager->setLocalConfigurationValueByPath('EXT/extConf/' . $extensionKey, serialize($configuration)); - $configurationManager->setLocalConfigurationValueByPath('EXTCONF/' . $extensionKey, $configuration); + $configurationManager->setLocalConfigurationValueByPath('EXTENSIONS/' . $extensionKey, $configuration); } /** @@ -80,14 +80,14 @@ class ConfigurationUtility implements \TYPO3\CMS\Core\SingletonInterface { $mergedConfiguration = $this->getDefaultConfigurationFromExtConfTemplateAsValuedArray($extensionKey); - // @deprecated loading serialized configuration is deprecated and will be removed in v10 - use EXTCONF array instead + // @deprecated loading serialized configuration is deprecated and will be removed in v10 - use EXTENSIONS array instead // No objects allowed in extConf at all - it is safe to deny that during unserialize() $legacyCurrentExtensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$extensionKey], ['allowed_classes' => false]); $legacyCurrentExtensionConfiguration = is_array($legacyCurrentExtensionConfiguration) ? $legacyCurrentExtensionConfiguration : []; $mergedConfiguration = $this->mergeExtensionConfigurations($mergedConfiguration, $legacyCurrentExtensionConfiguration); - if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey]) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey])) { - $currentExtensionConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey]; + if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$extensionKey]) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$extensionKey])) { + $currentExtensionConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$extensionKey]; $mergedConfiguration = $this->mergeExtensionConfigurations($mergedConfiguration, $currentExtensionConfiguration); } diff --git a/typo3/sysext/extensionmanager/Tests/Unit/Utility/ConfigurationUtilityTest.php b/typo3/sysext/extensionmanager/Tests/Unit/Utility/ConfigurationUtilityTest.php index ecbe829081f4..54c5f40d8fde 100644 --- a/typo3/sysext/extensionmanager/Tests/Unit/Utility/ConfigurationUtilityTest.php +++ b/typo3/sysext/extensionmanager/Tests/Unit/Utility/ConfigurationUtilityTest.php @@ -95,7 +95,7 @@ class ConfigurationUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes ]; $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$extensionKey] = serialize($serializedConfiguration); - $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey] = $currentExtconfConfiguration; + $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$extensionKey] = $currentExtconfConfiguration; $actual = $configurationUtility->getCurrentConfiguration($extensionKey); $this->assertEquals($expected, $actual); } -- GitLab