[BUGFIX] Fatal error in GeneralUtility::logDeprecatedFunction()
authorAndreas Wolf <andreas.wolf@typo3.org>
Sun, 2 Sep 2012 09:39:35 +0000 (11:39 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 22 Sep 2012 15:22:26 +0000 (17:22 +0200)
logDeprecatedFunction() uses DebugUtility::debugTrail(), which might not
be available when the deprecated function is called before or while
instantiating the autoloader.

Change-Id: Ieed83d524342e7fbe646a2b39759ff13438ec0e6
Resolves: #40521
Releases: 6.0, 4.7
Reviewed-on: http://review.typo3.org/14282
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Classes/Utility/GeneralUtility.php

index 65b2c83..790ed18 100644 (file)
@@ -4838,6 +4838,13 @@ Connection: close
                if (!$GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']) {
                        return;
                }
+
+                       // This require_once is needed for deprecation calls
+                       // thrown early during bootstrap, if the autoloader is
+                       // not instantiated yet. This can happen for example if
+                       // ext_localconf triggers a deprecation.
+               require_once 'DebugUtility.php';
+
                $trail = debug_backtrace();
                if ($trail[1]['type']) {
                        $function = new \ReflectionMethod($trail[1]['class'], $trail[1]['function']);