[TASK] Move global functions file out of Classes folder 70/41270/3
authorHelmut Hummel <helmut.hummel@typo3.org>
Wed, 15 Jul 2015 11:20:10 +0000 (13:20 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Wed, 15 Jul 2015 11:45:57 +0000 (13:45 +0200)
Releases: master
Resolves: #68159
Change-Id: Ic69f454cdb17c16d82aea5d2495b9ae795d600f6
Reviewed-on: http://review.typo3.org/41270
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
composer.json
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Core/GlobalDebugFunctions.php [deleted file]
typo3/sysext/core/Resources/PHP/GlobalDebugFunctions.php [new file with mode: 0644]
typo3/sysext/core/composer.json

index fe07815..479731f 100644 (file)
                },
                "classmap": [
                        "typo3/sysext/core/Resources/PHP/"
+               ],
+               "files": [
+                       "typo3/sysext/core/Resources/PHP/GlobalDebugFunctions.php"
                ]
        },
        "autoload-dev": {
index f55b78e..71f48f0 100644 (file)
@@ -369,7 +369,6 @@ class Bootstrap {
                        ->setDefaultTimezone()
                        ->initializeL10nLocales()
                        ->convertPageNotFoundHandlingToBoolean()
-                       ->registerGlobalDebugFunctions()
                        ->setMemoryLimit()
                        ->defineTypo3RequestTypes();
                if ($allowCaching) {
@@ -639,19 +638,6 @@ class Bootstrap {
        }
 
        /**
-        * Register xdebug(), debug(), debugBegin() and debugEnd() as global functions
-        *
-        * Note: Yes, this is possible in php! xdebug() is then a global function, even
-        * if registerGlobalDebugFunctions() is encapsulated in class scope.
-        *
-        * @return Bootstrap
-        */
-       protected function registerGlobalDebugFunctions() {
-               require_once('GlobalDebugFunctions.php');
-               return $this;
-       }
-
-       /**
         * Configure and set up exception and error handling
         *
         * @return Bootstrap
diff --git a/typo3/sysext/core/Classes/Core/GlobalDebugFunctions.php b/typo3/sysext/core/Classes/Core/GlobalDebugFunctions.php
deleted file mode 100644 (file)
index 4a97b7e..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-       // Simple debug function which prints output immediately
-       function xdebug($var = '', $debugTitle = 'xdebug') {
-               // If you wish to use the debug()-function, and it does not output something,
-               // please edit the IP mask in TYPO3_CONF_VARS
-               if (!\TYPO3\CMS\Core\Utility\GeneralUtility::cmpIP(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'])) {
-                       return;
-               }
-               \TYPO3\CMS\Core\Utility\DebugUtility::debug($var, $debugTitle);
-       }
-
-       // Debug function which calls $GLOBALS['error'] error handler if available
-       function debug($variable = '', $name = '*variable*', $line = '*line*', $file = '*file*', $recursiveDepth = 3, $debugLevel = E_DEBUG) {
-               // If you wish to use the debug()-function, and it does not output something,
-               // please edit the IP mask in TYPO3_CONF_VARS
-               if (!\TYPO3\CMS\Core\Utility\GeneralUtility::cmpIP(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'])) {
-                       return;
-               }
-               if (is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'], 'debug'))) {
-                       $GLOBALS['error']->debug($variable, $name, $line, $file, $recursiveDepth, $debugLevel);
-               } else {
-                       $title = $name === '*variable*' ? '' : $name;
-                       $group = $line === '*line*' ? NULL : $line;
-                       \TYPO3\CMS\Core\Utility\DebugUtility::debug($variable, $title, $group);
-               }
-       }
-
-       function debugBegin() {
-               if (is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'], 'debugBegin'))) {
-                       $GLOBALS['error']->debugBegin();
-               }
-       }
-
-       function debugEnd() {
-               if (is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'], 'debugEnd'))) {
-                       $GLOBALS['error']->debugEnd();
-               }
-       }
diff --git a/typo3/sysext/core/Resources/PHP/GlobalDebugFunctions.php b/typo3/sysext/core/Resources/PHP/GlobalDebugFunctions.php
new file mode 100644 (file)
index 0000000..4a97b7e
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+       // Simple debug function which prints output immediately
+       function xdebug($var = '', $debugTitle = 'xdebug') {
+               // If you wish to use the debug()-function, and it does not output something,
+               // please edit the IP mask in TYPO3_CONF_VARS
+               if (!\TYPO3\CMS\Core\Utility\GeneralUtility::cmpIP(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'])) {
+                       return;
+               }
+               \TYPO3\CMS\Core\Utility\DebugUtility::debug($var, $debugTitle);
+       }
+
+       // Debug function which calls $GLOBALS['error'] error handler if available
+       function debug($variable = '', $name = '*variable*', $line = '*line*', $file = '*file*', $recursiveDepth = 3, $debugLevel = E_DEBUG) {
+               // If you wish to use the debug()-function, and it does not output something,
+               // please edit the IP mask in TYPO3_CONF_VARS
+               if (!\TYPO3\CMS\Core\Utility\GeneralUtility::cmpIP(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE_ADDR'), $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask'])) {
+                       return;
+               }
+               if (is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'], 'debug'))) {
+                       $GLOBALS['error']->debug($variable, $name, $line, $file, $recursiveDepth, $debugLevel);
+               } else {
+                       $title = $name === '*variable*' ? '' : $name;
+                       $group = $line === '*line*' ? NULL : $line;
+                       \TYPO3\CMS\Core\Utility\DebugUtility::debug($variable, $title, $group);
+               }
+       }
+
+       function debugBegin() {
+               if (is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'], 'debugBegin'))) {
+                       $GLOBALS['error']->debugBegin();
+               }
+       }
+
+       function debugEnd() {
+               if (is_object($GLOBALS['error']) && @is_callable(array($GLOBALS['error'], 'debugEnd'))) {
+                       $GLOBALS['error']->debugEnd();
+               }
+       }
index 91bde47..5de0d4b 100644 (file)
@@ -25,7 +25,8 @@
                "psr-4": {
                        "TYPO3\\CMS\\Core\\": "Classes/"
                },
-               "classmap": ["Resources/PHP/"]
+               "classmap": ["Resources/PHP/"],
+               "files": ["typo3/sysext/core/Resources/PHP/GlobalDebugFunctions.php"]
        },
        "autoload-dev": {
                "psr-4": {