[!!!][TASK] Load main configuration file in functional context
authorHelmut Hummel <helmut.hummel@typo3.org>
Sat, 16 Jun 2012 20:23:30 +0000 (22:23 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 16 Jun 2012 22:05:24 +0000 (00:05 +0200)
Until now the localconf.php file is included in a global scope.
This is a major blocker for a clean and flexible bootstrapping.

Include the main configuration file in a method of the bootstrap class
and set all supported global variables as global.

Resolves: #38126
Releases: 6.0
Change-Id: I6bdb1f7624994272c577dcd141d3fc9b18258f9d
Reviewed-on: http://review.typo3.org/12138
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
t3lib/config_default.php
typo3/classes/Bootstrap/Backend.php

index c837a20..b399e38 100644 (file)
@@ -21,11 +21,8 @@ Typo3_Bootstrap_Backend::getInstance()
        ->registerExtDirectComponents()
        ->initializeGlobalVariables()
        ->checkLocalconfExistsOrDie()
-       ->setGlobalDatabaseVariablesToEmptyString();
-
-require(PATH_typo3conf . 'localconf.php');
-
-Typo3_Bootstrap_Backend::getInstance()
+       ->setGlobalDatabaseVariablesToEmptyString()
+       ->loadMainConfigurationFile()
        ->defineTypo3DatabaseConstants()
        ->initializeCachingFramework()
        ->registerAutoloader()
@@ -51,4 +48,4 @@ Typo3_Bootstrap_Backend::getInstance()
        ->defineLoggingAndExceptionConstants()
        ->unsetReservedGlobalVariables()
        ->initializeGlobalTimeVariables();
-?>
\ No newline at end of file
+?>
index f9d99b2..b749c27 100644 (file)
@@ -351,6 +351,18 @@ class Typo3_Bootstrap_Backend extends Typo3_Bootstrap_Abstract {
        }
 
        /**
+        * Loads the main configuration file (localconf.php)
+        *
+        * @return Typo3_Bootstrap_Backend
+        */
+       public function loadMainConfigurationFile() {
+               global $TYPO3_CONF_VARS, $typo_db, $typo_db_username, $typo_db_password, $typo_db_host, $typo_db_extTableDef_script;
+               require(PATH_typo3conf . 'localconf.php');
+
+               return $this;
+       }
+
+       /**
         * Define the database setup as constants
         * and unset no longer needed global variables
         *