[TASK] Protect bootstrap methods
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 25 Nov 2012 12:29:14 +0000 (13:29 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sun, 25 Nov 2012 20:25:50 +0000 (21:25 +0100)
With 6.0 the bootstrap related core code was split into small methods
and transferred to a group of encapsulating classes.
While this is an important step to get a flexible and maintainable
bootstrap in the end, this process is not completed and still misses
for example a real concept for scopes.
The patch groups methods used in all scopes in bootstrap wrapper
methods and makes the business methods protected. The whole API and
all affected classes are marked as "internal", together with a
warning that this API will change in the future and shouldn't be
used by 3rd party code that is not under core control.
This gives freedom for future development of this core code without
taking care of backwards compatibility. With previous versions there
was no API at all, so this is not a feature loss from an extension
point of view.

Change-Id: Ib841a19c766691fdeb7dab07280a005d6b67a938
Resolves: #43285
Releases: 6.0
Reviewed-on: http://review.typo3.org/16724
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
index.php
typo3/cli_dispatch.phpsh
typo3/init.php
typo3/install/index.php
typo3/sysext/cms/tslib/index_ts.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/Core/CliBootstrap.php
typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php
typo3/sysext/core/Classes/Log/LogRecord.php
typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php
typo3/sysext/install/Classes/InstallBootstrap.php

index df538e3..8485560 100644 (file)
--- a/index.php
+++ b/index.php
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
+*  (c) 1999-2012 Kasper Skårhøj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
 ***************************************************************/
 
 /**
- * This is the MAIN DOCUMENT of the TypoScript driven standard front-end (from the "cms" extension)
- * Basically this is the "index.php" script which all requests for TYPO3 delivered pages goes to in the frontend (the website)
+ * This is the MAIN DOCUMENT of the TypoScript driven standard frontend.
+ * Basically this is the "index.php" script which all requests for TYPO3
+ * delivered pages goes to in the frontend (the website)
  *
  * @author René Fritz <r.fritz@colorcube.de>
  */
 
-       // We use require instead of require_once here so we get a fatal error if classes/Bootstrap.php is accidentally included twice
-       // (which would indicate a clear bug).
 require 'typo3/sysext/core/Classes/Core/Bootstrap.php';
 \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->baseSetup('');
 
index 55ac772..d6e10a3 100755 (executable)
  *
  * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
  */
-
 define('TYPO3_MODE', 'BE');
 define('TYPO3_cliMode', TRUE);
 
-       // We use require instead of require_once here so we get a fatal error if classes/Bootstrap.php is accidentally included twice
-       // (which would indicate a clear bug).
 require __DIR__ . '/sysext/core/Classes/Core/CliBootstrap.php';
 \TYPO3\CMS\Core\Core\CliBootstrap::checkEnvironmentOrDie();
 
 require __DIR__ . '/sysext/core/Classes/Core/Bootstrap.php';
 \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
        ->baseSetup('typo3/')
-       ->populateLocalConfiguration()
-       ->registerExtDirectComponents()
-       ->initializeCachingFramework()
-       ->registerAutoloader()
-       ->checkUtf8DatabaseSettingsOrDie()
-       ->transferDeprecatedCurlSettings()
-       ->setCacheHashOptions()
-       ->enforceCorrectProxyAuthScheme()
-       ->setDefaultTimezone()
-       ->initializeL10nLocales()
-       ->configureImageProcessingOptions()
-       ->convertPageNotFoundHandlingToBoolean()
-       ->registerGlobalDebugFunctions()
-       ->registerSwiftMailer()
-       ->configureExceptionHandling()
-       ->setMemoryLimit()
-       ->defineTypo3RequestTypes()
-       ->populateTypo3LoadedExtGlobal(TRUE)
-       ->loadAdditionalConfigurationFromExtensions(TRUE)
-       ->deprecationLogForOldExtCacheSetting()
-       ->initializeExceptionHandling()
-       ->setFinalCachingFrameworkCacheConfiguration()
-       ->defineLoggingAndExceptionConstants()
-       ->unsetReservedGlobalVariables()
+       ->loadConfigurationAndInitialize()
+       ->loadTypo3LoadedExtAndExtLocalconf(TRUE)
+       ->applyAdditionalConfigurationSettings()
        ->initializeTypo3DbGlobal(TRUE);
+
 \TYPO3\CMS\Core\Core\CliBootstrap::initializeCliKeyOrDie();
+
 \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
        ->loadExtensionTables(TRUE)
        ->initializeBackendUser()
index d668232..f3272ad 100644 (file)
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * TYPO3 Backend initialization
  *
  * This script is called by every backend script.
  * The script authenticates the backend user.
- * In addition this script also initializes the database and other stuff by including the script localconf.php
+ * In addition this script also initializes the database and other depending on LocalConfiguration.php
  *
  * IMPORTANT:
  * This script exits if no user is logged in!
  */
 define('TYPO3_MODE', 'BE');
 
-       // We use require instead of require_once here so we get a fatal error if
-       // Bootstrap.php is accidentally included twice (which would indicate a clear bug).
 require 'sysext/core/Classes/Core/Bootstrap.php';
 
 \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
-       ->startOutputBuffering()
        ->baseSetup('typo3/')
-       ->populateLocalConfiguration()
-       ->registerExtDirectComponents()
-       ->initializeCachingFramework()
-       ->registerAutoloader()
-       ->checkUtf8DatabaseSettingsOrDie()
-       ->transferDeprecatedCurlSettings()
-       ->setCacheHashOptions()
-       ->enforceCorrectProxyAuthScheme()
-       ->setDefaultTimezone()
-       ->initializeL10nLocales()
-       ->configureImageProcessingOptions()
-       ->convertPageNotFoundHandlingToBoolean()
-       ->registerGlobalDebugFunctions()
-       ->registerSwiftMailer()
-       ->configureExceptionHandling()
-       ->setMemoryLimit()
-       ->defineTypo3RequestTypes()
-       ->populateTypo3LoadedExtGlobal(TRUE)
-       ->loadAdditionalConfigurationFromExtensions(TRUE)
-       ->deprecationLogForOldExtCacheSetting()
-       ->initializeExceptionHandling()
-       ->setFinalCachingFrameworkCacheConfiguration()
-       ->defineLoggingAndExceptionConstants()
-       ->unsetReservedGlobalVariables()
+       ->startOutputBuffering()
+       ->loadConfigurationAndInitialize()
+       ->loadTypo3LoadedExtAndExtLocalconf(TRUE)
+       ->applyAdditionalConfigurationSettings()
        ->initializeTypo3DbGlobal(FALSE)
        ->checkLockedBackendAndRedirectOrDie()
        ->checkBackendIpOrDie()
index ee52c2c..13d80a7 100755 (executable)
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Starter-script for install screen
  *
  * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
-ob_start();
 define('TYPO3_MODE', 'BE');
 define('TYPO3_enterInstallScript', '1');
 
-       // We use require instead of require_once here so we get a fatal error if classes/Bootstrap.php is accidentally included twice
-       // (which would indicate a clear bug).
 require '../sysext/core/Classes/Core/Bootstrap.php';
-\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->baseSetup('typo3/install/');
+\TYPO3\CMS\Core\Core\Bootstrap::getInstance()
+       ->baseSetup('typo3/install/');
 
 require '../sysext/install/Classes/InstallBootstrap.php';
 \TYPO3\CMS\Install\InstallBootstrap::checkEnabledInstallToolOrDie();
+
 \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
-       ->populateLocalConfiguration()
-       ->registerExtDirectComponents()
-       ->initializeCachingFramework()
-       ->registerAutoloader()
-       ->checkUtf8DatabaseSettingsOrDie()
-       ->transferDeprecatedCurlSettings()
-       ->setCacheHashOptions()
-       ->enforceCorrectProxyAuthScheme()
-       ->setDefaultTimezone()
-       ->initializeL10nLocales()
-       ->configureImageProcessingOptions()
-       ->convertPageNotFoundHandlingToBoolean()
-       ->registerGlobalDebugFunctions()
-       ->registerSwiftMailer()
-       ->configureExceptionHandling()
-       ->setMemoryLimit()
-       ->defineTypo3RequestTypes()
-       ->populateTypo3LoadedExtGlobal(FALSE)
-       ->loadAdditionalConfigurationFromExtensions(FALSE)
-       ->deprecationLogForOldExtCacheSetting()
-       ->initializeExceptionHandling()
-       ->setFinalCachingFrameworkCacheConfiguration()
-       ->defineLoggingAndExceptionConstants()
-       ->unsetReservedGlobalVariables()
+       ->startOutputBuffering()
+       ->loadConfigurationAndInitialize()
+       ->loadTypo3LoadedExtAndExtLocalconf(FALSE)
+       ->applyAdditionalConfigurationSettings()
        ->initializeTypo3DbGlobal(FALSE)
        ->checkLockedBackendAndRedirectOrDie()
        ->checkBackendIpOrDie()
index a1fb73e..550bfb6 100644 (file)
  *
  * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  */
-// Constants defined
+
 define('TYPO3_MODE', 'FE');
-// Prevent any output until AJAX/compression is initialized to stop
-// AJAX/compression data corruption
-ob_start();
 
 \TYPO3\CMS\Core\Core\Bootstrap::getInstance()
-       ->populateLocalConfiguration()
-       ->registerExtDirectComponents()
-       ->initializeCachingFramework()
-       ->registerAutoloader()
-       ->checkUtf8DatabaseSettingsOrDie()
-       ->transferDeprecatedCurlSettings()
-       ->setCacheHashOptions()
-       ->enforceCorrectProxyAuthScheme()
-       ->setDefaultTimezone()
-       ->initializeL10nLocales()
-       ->configureImageProcessingOptions()
-       ->convertPageNotFoundHandlingToBoolean()
-       ->registerGlobalDebugFunctions()
-       ->registerSwiftMailer()
-       ->configureExceptionHandling()
-       ->setMemoryLimit()
-       ->defineTypo3RequestTypes()
-       ->populateTypo3LoadedExtGlobal(TRUE)
-       ->loadAdditionalConfigurationFromExtensions(TRUE)
-       ->deprecationLogForOldExtCacheSetting()
-       ->initializeExceptionHandling()
-       ->setFinalCachingFrameworkCacheConfiguration()
-       ->defineLoggingAndExceptionConstants()
-       ->unsetReservedGlobalVariables();
+       ->startOutputBuffering()
+       ->loadConfigurationAndInitialize()
+       ->loadTypo3LoadedExtAndExtLocalconf(TRUE)
+       ->applyAdditionalConfigurationSettings();
 
 if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
        die('<strong>Error:</strong> The main frontend extension "cms" was not loaded. Enable it in the extension manager in the backend.');
index 0cfba70..795cf62 100644 (file)
@@ -1,6 +1,32 @@
 <?php
 namespace TYPO3\CMS\Core\Core;
 
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2012 Christian Kuhn <lolli@schwarzbu.ch>
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
 require 'SystemEnvironmentBuilder.php';
 
 /**
@@ -48,6 +74,7 @@ class Bootstrap {
         * Return 'this' as singleton
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        static public function getInstance() {
                if (is_null(self::$instance)) {
@@ -60,6 +87,7 @@ class Bootstrap {
         * Gets the request's unique ID
         *
         * @return string Unique request ID
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function getRequestId() {
                return $this->requestId;
@@ -70,6 +98,7 @@ class Bootstrap {
         * This does not interfere with "die()" or "echo"+"exit()" messages!
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function startOutputBuffering() {
                ob_start();
@@ -84,6 +113,7 @@ class Bootstrap {
         *
         * @param string $relativePathPart Relative path of the entry script back to document root
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function baseSetup($relativePathPart = '') {
                \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run($relativePathPart);
@@ -91,35 +121,75 @@ class Bootstrap {
        }
 
        /**
-        * Throws an exception if no browser could be identified
+        * Includes LocalConfiguration.php and sets several
+        * global settings depending on configuration.
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
-        * @throws \RuntimeException
+        * @internal This is not a public API method, do not use in own extensions
         */
-       public function checkValidBrowserOrDie() {
-               // Checks for proper browser
-               if (empty($GLOBALS['CLIENT']['BROWSER'])) {
-                       throw new \RuntimeException('Browser Error: Your browser version looks incompatible with this TYPO3 version!', 1294587023);
-               }
+       public function loadConfigurationAndInitialize() {
+               $this->getInstance()
+                       ->populateLocalConfiguration()
+                       ->registerExtDirectComponents()
+                       ->initializeCachingFramework()
+                       ->registerAutoloader()
+                       ->checkUtf8DatabaseSettingsOrDie()
+                       ->transferDeprecatedCurlSettings()
+                       ->setCacheHashOptions()
+                       ->enforceCorrectProxyAuthScheme()
+                       ->setDefaultTimezone()
+                       ->initializeL10nLocales()
+                       ->configureImageProcessingOptions()
+                       ->convertPageNotFoundHandlingToBoolean()
+                       ->registerGlobalDebugFunctions()
+                       ->registerSwiftMailer()
+                       ->configureExceptionHandling()
+                       ->setMemoryLimit()
+                       ->defineTypo3RequestTypes();
                return $this;
        }
 
        /**
-        * Register default ExtDirect components
+        * Load TYPO3_LOADED_EXT and ext_localconf
+        *
+        * @param boolean $allowCaching
+        * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
+        */
+       public function loadTypo3LoadedExtAndExtLocalconf($allowCaching = TRUE) {
+               $this->getInstance()
+                       ->populateTypo3LoadedExtGlobal($allowCaching)
+                       ->loadAdditionalConfigurationFromExtensions($allowCaching);
+               return $this;
+       }
+
+       /**
+        * Sets up additional configuration applied in all scopes
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
-       public function registerExtDirectComponents() {
-               if (TYPO3_MODE === 'BE') {
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.Components.PageTree.DataProvider', 'TYPO3\\CMS\\Backend\\Tree\\Pagetree\\ExtdirectTreeDataProvider', 'web', 'user,group');
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.Components.PageTree.Commands', 'TYPO3\\CMS\\Backend\\Tree\\Pagetree\\ExtdirectTreeCommands', 'web', 'user,group');
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.Components.PageTree.ContextMenuDataProvider', 'TYPO3\\CMS\\Backend\\ContextMenu\\Pagetree\\Extdirect\\ContextMenuConfiguration', 'web', 'user,group');
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.LiveSearchActions.ExtDirect', 'TYPO3\\CMS\\Backend\\Search\\LiveSearch\\ExtDirect\\LiveSearchDataProvider', 'web_list', 'user,group');
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.BackendUserSettings.ExtDirect', 'TYPO3\\CMS\\Backend\\User\\ExtDirect\\BackendUserSettingsDataProvider');
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.CSH.ExtDirect', 'TYPO3\\CMS\\ContextHelp\\ExtDirect\\ContextHelpDataProvider');
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.ExtDirectStateProvider.ExtDirect', 'TYPO3\\CMS\\Backend\\InterfaceState\\ExtDirect\\DataProvider');
-                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.Components.DragAndDrop.CommandController',
-                                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('backend') . 'Classes/View/PageLayout/Extdirect/ExtdirectPageCommands.php:TYPO3\\CMS\\Backend\\View\\PageLayout\\ExtDirect\\ExtdirectPageCommands', 'web', 'user,group');
+       public function applyAdditionalConfigurationSettings() {
+               $this->getInstance()
+                       ->deprecationLogForOldExtCacheSetting()
+                       ->initializeExceptionHandling()
+                       ->setFinalCachingFrameworkCacheConfiguration()
+                       ->defineLoggingAndExceptionConstants()
+                       ->unsetReservedGlobalVariables();
+               return $this;
+       }
+
+       /**
+        * Throws an exception if no browser could be identified
+        *
+        * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @throws \RuntimeException
+        * @internal This is not a public API method, do not use in own extensions
+        */
+       public function checkValidBrowserOrDie() {
+               // Checks for proper browser
+               if (empty($GLOBALS['CLIENT']['BROWSER'])) {
+                       throw new \RuntimeException('Browser Error: Your browser version looks incompatible with this TYPO3 version!', 1294587023);
                }
                return $this;
        }
@@ -131,7 +201,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function populateLocalConfiguration() {
+       protected function populateLocalConfiguration() {
                try {
                        // We need an early instance of the configuration manager.
                        // Since makeInstance relies on the object configuration, we create it here with new instead
@@ -153,9 +223,30 @@ class Bootstrap {
        }
 
        /**
+        * Register default ExtDirect components
+        *
+        * @return \TYPO3\CMS\Core\Core\Bootstrap
+        */
+       protected function registerExtDirectComponents() {
+               if (TYPO3_MODE === 'BE') {
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.Components.PageTree.DataProvider', 'TYPO3\\CMS\\Backend\\Tree\\Pagetree\\ExtdirectTreeDataProvider', 'web', 'user,group');
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.Components.PageTree.Commands', 'TYPO3\\CMS\\Backend\\Tree\\Pagetree\\ExtdirectTreeCommands', 'web', 'user,group');
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.Components.PageTree.ContextMenuDataProvider', 'TYPO3\\CMS\\Backend\\ContextMenu\\Pagetree\\Extdirect\\ContextMenuConfiguration', 'web', 'user,group');
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.LiveSearchActions.ExtDirect', 'TYPO3\\CMS\\Backend\\Search\\LiveSearch\\ExtDirect\\LiveSearchDataProvider', 'web_list', 'user,group');
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.BackendUserSettings.ExtDirect', 'TYPO3\\CMS\\Backend\\User\\ExtDirect\\BackendUserSettingsDataProvider');
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.CSH.ExtDirect', 'TYPO3\\CMS\\ContextHelp\\ExtDirect\\ContextHelpDataProvider');
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.ExtDirectStateProvider.ExtDirect', 'TYPO3\\CMS\\Backend\\InterfaceState\\ExtDirect\\DataProvider');
+                       \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerExtDirectComponent('TYPO3.Components.DragAndDrop.CommandController',
+                               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('backend') . 'Classes/View/PageLayout/Extdirect/ExtdirectPageCommands.php:TYPO3\\CMS\\Backend\\View\\PageLayout\\ExtDirect\\ExtdirectPageCommands', 'web', 'user,group');
+               }
+               return $this;
+       }
+
+       /**
         * Redirect to install tool if database host and database are not defined
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function redirectToInstallToolIfDatabaseCredentialsAreMissing() {
                if (!TYPO3_db_host && !TYPO3_db) {
@@ -169,7 +260,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function initializeCachingFramework() {
+       protected function initializeCachingFramework() {
                \TYPO3\CMS\Core\Cache\Cache::initializeCachingFramework();
                return $this;
        }
@@ -179,7 +270,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function registerAutoloader() {
+       protected function registerAutoloader() {
                if (PHP_VERSION_ID < 50307) {
                        \TYPO3\CMS\Core\Compatibility\CompatbilityClassLoaderPhpBelow50307::registerAutoloader();
                } else {
@@ -199,7 +290,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function checkUtf8DatabaseSettingsOrDie() {
+       protected function checkUtf8DatabaseSettingsOrDie() {
                // Check if [BE][forceCharset] has been set in localconf.php
                if (isset($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'])) {
                        // die() unless we're already on UTF-8
@@ -224,7 +315,7 @@ class Bootstrap {
         * @TODO : This code segment must still be finished
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function transferDeprecatedCurlSettings() {
+       protected function transferDeprecatedCurlSettings() {
                if (!empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyServer'])) {
                        $proxyParts = explode(':', $GLOBALS['TYPO3_CONF_VARS']['SYS']['curlProxyServer'], 2);
                        $GLOBALS['TYPO3_CONF_VARS']['HTTP']['proxy_host'] = $proxyParts[0];
@@ -243,7 +334,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function setCacheHashOptions() {
+       protected function setCacheHashOptions() {
                $GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash'] = array(
                        'cachedParametersWhiteList' => \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['FE']['cHashOnlyForParameters'], TRUE),
                        'excludedParameters' => \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['FE']['cHashExcludedParameters'], TRUE),
@@ -263,7 +354,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function enforceCorrectProxyAuthScheme() {
+       protected function enforceCorrectProxyAuthScheme() {
                $GLOBALS['TYPO3_CONF_VARS']['HTTP']['proxy_auth_scheme'] === 'digest' ?: ($GLOBALS['TYPO3_CONF_VARS']['HTTP']['proxy_auth_scheme'] = 'basic');
                return $this;
        }
@@ -273,7 +364,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function setDefaultTimezone() {
+       protected function setDefaultTimezone() {
                $timeZone = $GLOBALS['TYPO3_CONF_VARS']['SYS']['phpTimeZone'];
                if (empty($timeZone)) {
                        // Time zone from the server environment (TZ env or OS query)
@@ -294,7 +385,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function initializeL10nLocales() {
+       protected function initializeL10nLocales() {
                \TYPO3\CMS\Core\Localization\Locales::initialize();
                return $this;
        }
@@ -305,7 +396,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function configureImageProcessingOptions() {
+       protected function configureImageProcessingOptions() {
                if (!$GLOBALS['TYPO3_CONF_VARS']['GFX']['image_processing']) {
                        $GLOBALS['TYPO3_CONF_VARS']['GFX']['im'] = 0;
                        $GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib'] = 0;
@@ -340,7 +431,7 @@ class Bootstrap {
         * @TODO : Remove, if the Install Tool handles such data types correctly
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function convertPageNotFoundHandlingToBoolean() {
+       protected function convertPageNotFoundHandlingToBoolean() {
                if (!strcasecmp($GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling'], 'TRUE')) {
                        $GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling'] = TRUE;
                }
@@ -355,7 +446,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function registerGlobalDebugFunctions() {
+       protected function registerGlobalDebugFunctions() {
                require_once('GlobalDebugFunctions.php');
                return $this;
        }
@@ -365,7 +456,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function registerSwiftMailer() {
+       protected function registerSwiftMailer() {
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/utility/class.t3lib_utility_mail.php']['substituteMailDelivery'][] = 'TYPO3\\CMS\\Core\\Mail\\SwiftMailerAdapter';
                return $this;
        }
@@ -375,7 +466,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function configureExceptionHandling() {
+       protected function configureExceptionHandling() {
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['errors']['exceptionHandler'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['productionExceptionHandler'];
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['errors']['exceptionalErrors'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['exceptionalErrors'];
                // Turn error logging on/off.
@@ -409,7 +500,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function setMemoryLimit() {
+       protected function setMemoryLimit() {
                if (intval($GLOBALS['TYPO3_CONF_VARS']['SYS']['setMemoryLimit']) > 16) {
                        @ini_set('memory_limit', (intval($GLOBALS['TYPO3_CONF_VARS']['SYS']['setMemoryLimit']) . 'm'));
                }
@@ -422,7 +513,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function defineTypo3RequestTypes() {
+       protected function defineTypo3RequestTypes() {
                define('TYPO3_REQUESTTYPE_FE', 1);
                define('TYPO3_REQUESTTYPE_BE', 2);
                define('TYPO3_REQUESTTYPE_CLI', 4);
@@ -439,7 +530,7 @@ class Bootstrap {
         * @param boolean $allowCaching
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function populateTypo3LoadedExtGlobal($allowCaching = TRUE) {
+       protected function populateTypo3LoadedExtGlobal($allowCaching = TRUE) {
                $GLOBALS['TYPO3_LOADED_EXT'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadTypo3LoadedExtensionInformation($allowCaching);
                return $this;
        }
@@ -453,7 +544,7 @@ class Bootstrap {
         * @param boolean $allowCaching
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function loadAdditionalConfigurationFromExtensions($allowCaching = TRUE) {
+       protected function loadAdditionalConfigurationFromExtensions($allowCaching = TRUE) {
                \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtLocalconf($allowCaching);
                return $this;
        }
@@ -464,7 +555,7 @@ class Bootstrap {
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         * @deprecated since 6.0, the check will be removed two version later.
         */
-       public function deprecationLogForOldExtCacheSetting() {
+       protected function deprecationLogForOldExtCacheSetting() {
                if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['extCache']) && $GLOBALS['TYPO3_CONF_VARS']['SYS']['extCache'] !== -1) {
                        \TYPO3\CMS\Core\Utility\GeneralUtility::deprecationLog('Setting $GLOBALS[\'TYPO3_CONF_VARS\'][\'SYS\'][\'extCache\'] is unused and can be removed from localconf.php');
                }
@@ -476,7 +567,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function initializeExceptionHandling() {
+       protected function initializeExceptionHandling() {
                if ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['errors']['exceptionHandler'] !== '') {
                        if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['errorHandler'] !== '') {
                                // Register an error handler for the given errorHandlerErrors
@@ -497,7 +588,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function setFinalCachingFrameworkCacheConfiguration() {
+       protected function setFinalCachingFrameworkCacheConfiguration() {
                $GLOBALS['typo3CacheManager']->setCacheConfigurations($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']);
                return $this;
        }
@@ -507,7 +598,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function defineLoggingAndExceptionConstants() {
+       protected function defineLoggingAndExceptionConstants() {
                define('TYPO3_DLOG', $GLOBALS['TYPO3_CONF_VARS']['SYS']['enable_DLOG']);
                define('TYPO3_ERROR_DLOG', $GLOBALS['TYPO3_CONF_VARS']['SYS']['enable_errorDLOG']);
                define('TYPO3_EXCEPTION_DLOG', $GLOBALS['TYPO3_CONF_VARS']['SYS']['enable_exceptionDLOG']);
@@ -520,7 +611,7 @@ class Bootstrap {
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
-       public function unsetReservedGlobalVariables() {
+       protected function unsetReservedGlobalVariables() {
                unset($GLOBALS['PAGES_TYPES']);
                unset($GLOBALS['TCA']);
                unset($GLOBALS['TBE_MODULES']);
@@ -541,11 +632,12 @@ class Bootstrap {
        /**
         * Initialize t3lib_db in $GLOBALS and connect if requested
         *
-        * @param boolean $connect Whether or not the db should be connected already
+        * @param boolean $connect Whether db should be connected
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function initializeTypo3DbGlobal($connect = TRUE) {
-               /** @var TYPO3_DB t3lib_db */
+               /** @var TYPO3_DB TYPO3\CMS\Core\Database\DatabaseConnection */
                $GLOBALS['TYPO3_DB'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Database\\DatabaseConnection');
                $GLOBALS['TYPO3_DB']->debugOutput = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sqlDebug'];
                if ($connect) {
@@ -560,6 +652,7 @@ class Bootstrap {
         *
         * @throws \RuntimeException
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function checkLockedBackendAndRedirectOrDie() {
                if ($GLOBALS['TYPO3_CONF_VARS']['BE']['adminOnly'] < 0) {
@@ -586,6 +679,7 @@ class Bootstrap {
         * if the client is not allowed to access the backend
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function checkBackendIpOrDie() {
                if (trim($GLOBALS['TYPO3_CONF_VARS']['BE']['IPmaskList'])) {
@@ -606,6 +700,7 @@ class Bootstrap {
         * to https version of the backend if needed
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function checkSslBackendAndRedirectIfNeeded() {
                if (intval($GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'])) {
@@ -644,6 +739,7 @@ class Bootstrap {
         * Establish connection to the database
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function establishDatabaseConnection() {
                $GLOBALS['TYPO3_DB']->connectDB();
@@ -668,6 +764,7 @@ class Bootstrap {
         * @TODO : It should be defined, which global arrays are ok to be manipulated
         * @param boolean $allowCaching True, if reading compiled ext_tables file from cache is allowed
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function loadExtensionTables($allowCaching = TRUE) {
                // It is discouraged to use those global variables directly, but we
@@ -712,6 +809,7 @@ class Bootstrap {
         * Initialize sprite manager
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function initializeSpriteManager() {
                \TYPO3\CMS\Backend\Sprite\SpriteManager::initialize();
@@ -722,6 +820,7 @@ class Bootstrap {
         * Initialize backend user object in globals
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function initializeBackendUser() {
                /** @var $backendUser \TYPO3\CMS\Core\Authentication\BackendUserAuthentication */
@@ -744,6 +843,7 @@ class Bootstrap {
         * Initialize backend user mount points
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function initializeBackendUserMounts() {
                // Includes deleted mount pages as well! @TODO: Figure out why ...
@@ -756,6 +856,7 @@ class Bootstrap {
         * Initialize language object
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function initializeLanguageObject() {
                /** @var $GLOBALS['LANG'] \TYPO3\CMS\Lang\LanguageService */
@@ -768,6 +869,7 @@ class Bootstrap {
         * Throw away all output that may have happened during bootstrapping by weird extensions
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function endOutputBufferingAndCleanPreviousOutput() {
                ob_clean();
@@ -778,6 +880,7 @@ class Bootstrap {
         * Initialize output compression if configured
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function initializeOutputCompression() {
                if (extension_loaded('zlib') && $GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel']) {
@@ -793,6 +896,7 @@ class Bootstrap {
         * Initialize module menu object
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function initializeModuleMenuObject() {
                /** @var $moduleMenuUtility Typo3_BackendModule_Utility */
@@ -807,6 +911,7 @@ class Bootstrap {
         * shut down of the system.
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function shutdown() {
                if (PHP_VERSION_ID < 50307) {
@@ -822,6 +927,7 @@ class Bootstrap {
         * work with.
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
+        * @internal This is not a public API method, do not use in own extensions
         */
        public function initializeBackendTemplate() {
                $GLOBALS['TBE_TEMPLATE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
@@ -831,4 +937,4 @@ class Bootstrap {
 }
 
 
-?>
\ No newline at end of file
+?>
index b6a2303..63f99ec 100644 (file)
@@ -29,6 +29,10 @@ namespace TYPO3\CMS\Core\Core;
 /**
  * This class encapsulates cli specific bootstrap methods.
  *
+ * This script is internal code and subject to change.
+ * DO NOT use it in own code, or be prepared your code might
+ * break in future core versions.
+ *
  * @author Christian Kuhn <lolli@schwarzbu.ch>
  */
 class CliBootstrap {
@@ -37,6 +41,7 @@ class CliBootstrap {
         * Check the script is called from a cli environment.
         *
         * @return void
+        * @internal This is not a public API method, do not use in own extensions
         */
        static public function checkEnvironmentOrDie() {
                if (substr(php_sapi_name(), 0, 3) === 'cgi') {
@@ -52,6 +57,7 @@ class CliBootstrap {
         * If it is not set or not valid, the script exits with an error message.
         *
         * @return void
+        * @internal This is not a public API method, do not use in own extensions
         */
        static public function initializeCliKeyOrDie() {
                if (!isset($_SERVER['argv'][1]) || !is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys'][$_SERVER['argv'][1]])) {
index 2742f77..6ec9566 100644 (file)
@@ -26,11 +26,11 @@ namespace TYPO3\CMS\Core\Core;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Class to encapsulate base setup of bootstrap.
  *
- * This class contains all code that must be executed by every
- * entry script without exceptions.
+ * This class contains all code that must be executed by every entry script.
  *
  * It sets up all basic paths, constants, global variables and checks
  * the basic environment TYPO3 runs in.
@@ -41,12 +41,18 @@ namespace TYPO3\CMS\Core\Core;
  *
  * The script aborts execution with an error message if
  * some part fails or conditions are not met.
+ *
+ * This script is internal code and subject to change.
+ * DO NOT use it in own code, or be prepared your code might
+ * break in future versions of the core.
  */
 class SystemEnvironmentBuilder {
 
        /**
         * Run base setup.
+        * This entry method is used in all scopes (FE, BE, eid, ajax, ...)
         *
+        * @internal This method should not be used by 3rd party code. It will change without further notice.
         * @param string $relativePathPart Relative path of the entry script back to document root
         * @return void
         */
index 2329dde..69a2bdf 100644 (file)
@@ -108,7 +108,12 @@ class LogRecord implements \ArrayAccess {
         * @param array $data Additional data
         */
        public function __construct($component = '', $level, $message, array $data = array()) {
-               $this->setRequestId(\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->getRequestId())->setCreated(microtime(TRUE))->setComponent($component)->setLevel($level)->setMessage($message)->setData($data);
+               $this->setRequestId(\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->getRequestId())
+                       ->setCreated(microtime(TRUE))
+                       ->setComponent($component)
+                       ->setLevel($level)
+                       ->setMessage($message)
+                       ->setData($data);
        }
 
        /**
index 4d45dbc..ce7358d 100644 (file)
@@ -275,7 +275,7 @@ class InstallUtility implements \TYPO3\CMS\Core\SingletonInterface {
                $localConfiguration = $this->configurationManager->getLocalConfiguration();
                $GLOBALS['TYPO3_CONF_VARS']['EXT']['extListArray'] = $localConfiguration['EXT']['extListArray'];
                $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'] = implode(',', $GLOBALS['TYPO3_CONF_VARS']['EXT']['extListArray']);
-               \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->populateTypo3LoadedExtGlobal(FALSE)->loadAdditionalConfigurationFromExtensions(FALSE);
+               \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadTypo3LoadedExtAndExtLocalconf(FALSE);
        }
 
        /**
index c657b59..60e1c5f 100644 (file)
@@ -29,6 +29,10 @@ namespace TYPO3\CMS\Install;
 /**
  * Encapsulate install tool specific bootstrap methods.
  *
+ * This script is internal code and subject to change.
+ * DO NOT use it in own code, or be prepared your code might
+ * break in future core versions.
+ *
  * @author Christian Kuhn <lolli@schwarzbu.ch>
  */
 class InstallBootstrap {
@@ -38,6 +42,7 @@ class InstallBootstrap {
         * or exit the script if conditions to access the install tool are not met.
         *
         * @return void
+        * @internal This is not a public API method, do not use in own extensions
         */
        static public function checkEnabledInstallToolOrDie() {
                $quickstartFile = PATH_site . 'typo3conf/FIRST_INSTALL';