From 4f9dc49db43d628b07008799ae0c9131e6bf8631 Mon Sep 17 00:00:00 2001 From: Christian Kuhn <lolli@schwarzbu.ch> Date: Thu, 30 Mar 2017 21:45:07 +0200 Subject: [PATCH] [TASK] Deprecate TYPO3_CONF_VARS_extensionAdded The global array $GLOBALS['TYPO3_CONF_VARS_extensionAdded'] is widely unknown and of little use. Deprecate it along with helper method ExtensionManagementUtility::appendToTypoConfVars() Change-Id: Ia21324bece77aefee05fc3ff96ad756c5a0f0a12 Resolves: #80583 Releases: master Reviewed-on: https://review.typo3.org/52271 Reviewed-by: Andreas Fernandez <typo3@scripting-base.de> Tested-by: Andreas Fernandez <typo3@scripting-base.de> Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: Benni Mack <benni@typo3.org> --- .../Utility/ExtensionManagementUtility.php | 18 +++++----- ...n-80583-TYPO3_CONF_VARS_extensionAdded.rst | 33 +++++++++++++++++++ .../Action/Tool/AllConfiguration.php | 1 + 3 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 typo3/sysext/core/Documentation/Changelog/master/Deprecation-80583-TYPO3_CONF_VARS_extensionAdded.rst diff --git a/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php b/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php index a9e62b7bedf2..ce901c5137bb 100644 --- a/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php +++ b/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php @@ -1023,9 +1023,11 @@ class ExtensionManagementUtility * @param string $group The group ('FE', 'BE', 'SYS' ...) * @param string $key The key of this setting within the group * @param string $content The text to add (include leading "\n" in case of multi-line entries) + * @deprecated since TYPO3 v8, will be removed in TYPO3 v9 */ public static function appendToTypoConfVars($group, $key, $content) { + GeneralUtility::logDeprecatedFunction(); $GLOBALS['TYPO3_CONF_VARS_extensionAdded'][$group][$key] .= $content; $GLOBALS['TYPO3_CONF_VARS'][$group][$key] .= $content; } @@ -1039,9 +1041,9 @@ class ExtensionManagementUtility */ public static function addPageTSConfig($content) { - self::appendToTypoConfVars('BE', 'defaultPageTSconfig', ' + $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig'] .= ' [GLOBAL] -' . $content); +' . $content; } /** @@ -1053,9 +1055,9 @@ class ExtensionManagementUtility */ public static function addUserTSConfig($content) { - self::appendToTypoConfVars('BE', 'defaultUserTSconfig', ' + $GLOBALS['TYPO3_CONF_VARS']['BE']['defaultUserTSconfig'] .= ' [GLOBAL] -' . $content); +' . $content; } /** @@ -1473,9 +1475,9 @@ tt_content.' . $key . $suffix . ' { */ public static function addTypoScriptSetup($content) { - self::appendToTypoConfVars('FE', 'defaultTypoScript_setup', ' + $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_setup'] .= ' [GLOBAL] -' . $content); +' . $content; } /** @@ -1487,9 +1489,9 @@ tt_content.' . $key . $suffix . ' { */ public static function addTypoScriptConstants($content) { - self::appendToTypoConfVars('FE', 'defaultTypoScript_constants', ' + $GLOBALS['TYPO3_CONF_VARS']['FE']['defaultTypoScript_constants'] .= ' [GLOBAL] -' . $content); +' . $content; } /** diff --git a/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80583-TYPO3_CONF_VARS_extensionAdded.rst b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80583-TYPO3_CONF_VARS_extensionAdded.rst new file mode 100644 index 000000000000..1afc4ebe15a6 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Deprecation-80583-TYPO3_CONF_VARS_extensionAdded.rst @@ -0,0 +1,33 @@ +.. include:: ../../Includes.txt + +==================================================== +Deprecation: #80583 - TYPO3_CONF_VARS_extensionAdded +==================================================== + +See :issue:`80583` + +Description +=========== + +The global array :code:`$GLOBALS['TYPO3_CONF_VARS_extensionAdded']` has been deprecated along with the method :code:`ExtensionManagementUtility::appendToTypoConfVars()` + + +Impact +====== + +Using method :code:`appendToTypoConfVars()` throws a deprecation warning and accessing +:code:`$GLOBALS['TYPO3_CONF_VARS_extensionAdded']` will stop working with core version 9. + + +Affected Installations +====================== + +Extensions using :code:`$GLOBALS['TYPO3_CONF_VARS_extensionAdded']` or method :code:`appendToTypoConfVars()` + + +Migration +========= + +Access :code:`$GLOBALS['TYPO3_CONF_VARS']` directly. + +.. index:: LocalConfiguration, PHP-API \ No newline at end of file diff --git a/typo3/sysext/install/Classes/Controller/Action/Tool/AllConfiguration.php b/typo3/sysext/install/Classes/Controller/Action/Tool/AllConfiguration.php index d111bc0c78d8..eccd7425780d 100644 --- a/typo3/sysext/install/Classes/Controller/Action/Tool/AllConfiguration.php +++ b/typo3/sysext/install/Classes/Controller/Action/Tool/AllConfiguration.php @@ -88,6 +88,7 @@ class AllConfiguration extends Action\AbstractAction $data[$sectionName] = []; foreach ($GLOBALS['TYPO3_CONF_VARS'][$sectionName] as $key => $value) { + // @deprecated since TYPO3 v8, will be removed in TYPO3 v9. The array TYPO3_CONF_VARS_extensionAdded will be removed in v9. if (isset($GLOBALS['TYPO3_CONF_VARS_extensionAdded'][$sectionName][$key])) { // Don't allow editing stuff which is added by extensions // Make sure we fix potentially duplicated entries from older setups -- GitLab