[BUGFIX] class_alias in the bootstrap for legacy base classes
authorHelmut Hummel <helmut.hummel@typo3.org>
Thu, 20 Sep 2012 16:10:48 +0000 (18:10 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Wed, 31 Oct 2012 22:43:06 +0000 (23:43 +0100)
The legacy base classes t3lib_div and t3lib_extMgm used
to be available early in the bootstrap.

To enable the usage of the old class names a class alias
needs to be set up right after these classes are included.

Change-Id: I3cfa69d9bbca378015ee5ea3c13a6fac032fe9cc
Fixes: #42574
Resolves: #41122
Releases: 6.0
Reviewed-on: http://review.typo3.org/14776
Reviewed-by: Nicole Cordes
Tested-by: Nicole Cordes
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php

index 436ab46..3fe21bb 100644 (file)
@@ -57,6 +57,7 @@ class SystemEnvironmentBuilder {
                self::definePaths($relativePathPart);
                self::checkMainPathsExist();
                self::requireBaseClasses();
+               self::setupClassAliasForLegacyBaseClasses();
                self::handleMagicQuotesGpc();
                self::addCorePearPathToIncludePath();
                self::initializeGlobalVariables();
@@ -234,6 +235,18 @@ class SystemEnvironmentBuilder {
        }
 
        /**
+        * Compatibility layer for early t3lib_div or t3lib_extMgm usage
+        *
+        * @return void
+        * @deprecated since 6.0, will be removed in 7.0
+        * @see t3lib/class.t3lib_div.php, t3lib/class.t3lib_extmgm.php
+        */
+       static public function setupClassAliasForLegacyBaseClasses() {
+               class_alias('TYPO3\\CMS\\Core\\Utility\\GeneralUtility', 't3lib_div');
+               class_alias('TYPO3\\CMS\\Core\\Extension\\ExtensionManager', 't3lib_extMgm');
+       }
+
+       /**
         * Compatibility layer for magic quotes
         *
         * @return void