diff --git a/index.php b/index.php index df538e319b783ceb69bfdaafcfe28328ad54c742..848556065c09c8892d44840cf3692600a369f872 100644 --- 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 @@ -26,14 +26,13 @@ ***************************************************************/ /** - * 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(''); diff --git a/typo3/cli_dispatch.phpsh b/typo3/cli_dispatch.phpsh index 55ac772685a71cb67531fe46ccee51ead88bed93..d6e10a34f1669d2d415beba72d435631f3bbc44b 100755 --- a/typo3/cli_dispatch.phpsh +++ b/typo3/cli_dispatch.phpsh @@ -36,44 +36,22 @@ * * @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() diff --git a/typo3/init.php b/typo3/init.php index d668232b60d545269bda4b04446f350c8d4ec249..f3272ad452940c5afbff688d5c648a2cb3cd45e1 100644 --- a/typo3/init.php +++ b/typo3/init.php @@ -24,12 +24,13 @@ * * 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! @@ -53,37 +54,14 @@ */ 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() diff --git a/typo3/install/index.php b/typo3/install/index.php index ee52c2c2f15794b07ea0b0834289be7511fa5d20..13d80a717b0dbf2fd63325d32aa377004e667f7f 100755 --- a/typo3/install/index.php +++ b/typo3/install/index.php @@ -24,47 +24,27 @@ * * 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() diff --git a/typo3/sysext/cms/tslib/index_ts.php b/typo3/sysext/cms/tslib/index_ts.php index a1fb73e6ccb7f7101da0ec97cb6eb175665780a5..550bfb62a9bbf9ffbd12c26844e063d0482fb21d 100644 --- a/typo3/sysext/cms/tslib/index_ts.php +++ b/typo3/sysext/cms/tslib/index_ts.php @@ -34,37 +34,14 @@ * * @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.'); diff --git a/typo3/sysext/core/Classes/Core/Bootstrap.php b/typo3/sysext/core/Classes/Core/Bootstrap.php index 0cfba704f975c9b6e16e8d480190d6a5bac8ef6d..795cf62abd6aa88814b6739b1804693dc2b629fb 100644 --- a/typo3/sysext/core/Classes/Core/Bootstrap.php +++ b/typo3/sysext/core/Classes/Core/Bootstrap.php @@ -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 @@ -152,10 +222,31 @@ class Bootstrap { return $this; } + /** + * 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 +?> diff --git a/typo3/sysext/core/Classes/Core/CliBootstrap.php b/typo3/sysext/core/Classes/Core/CliBootstrap.php index b6a2303a80c1a55954901308f6568d4485ebd584..63f99ecb21b56dd33206299ee5a6c5d79cdeaf1b 100644 --- a/typo3/sysext/core/Classes/Core/CliBootstrap.php +++ b/typo3/sysext/core/Classes/Core/CliBootstrap.php @@ -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]])) { diff --git a/typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php b/typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php index 2742f779589e5e911c60c5e4d7e7d83ae234dcad..6ec9566d7e66f2a032e847ab4bddf4b3a7723daa 100644 --- a/typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php +++ b/typo3/sysext/core/Classes/Core/SystemEnvironmentBuilder.php @@ -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 */ diff --git a/typo3/sysext/core/Classes/Log/LogRecord.php b/typo3/sysext/core/Classes/Log/LogRecord.php index 2329dde2ea25c17159707cdfd0e1120bbbb4ecea..69a2bdf69d7839babfbc75f6fb65bb7d03715ad0 100644 --- a/typo3/sysext/core/Classes/Log/LogRecord.php +++ b/typo3/sysext/core/Classes/Log/LogRecord.php @@ -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); } /** diff --git a/typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php b/typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php index 4d45dbc195008a745831cd6dccde546a151870e1..ce7358d7e52a8870f8fb6cd1aeca6b016b1bdd4a 100644 --- a/typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php +++ b/typo3/sysext/extensionmanager/Classes/Utility/InstallUtility.php @@ -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); } /** diff --git a/typo3/sysext/install/Classes/InstallBootstrap.php b/typo3/sysext/install/Classes/InstallBootstrap.php index c657b59c5f9c090e1476ea4359354815ca6b9b0e..60e1c5fcf6364a29749353a5cf086817bb3a046f 100644 --- a/typo3/sysext/install/Classes/InstallBootstrap.php +++ b/typo3/sysext/install/Classes/InstallBootstrap.php @@ -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';