TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\Core\Bootstrap Class Reference

Public Member Functions

 getRequestId ()
 
 getApplicationContext ()
 
 startOutputBuffering ()
 
 baseSetup ($relativePathPart='')
 
 redirectToInstallerIfEssentialConfigurationDoesNotExist ($pathUpToDocumentRoot='')
 
 setEarlyInstance ($objectName, $instance)
 
 getEarlyInstance ($objectName)
 
 getEarlyInstances ()
 
 loadConfigurationAndInitialize ($allowCaching=TRUE, $packageManagerClassName='TYPO3\\CMS\\Core\\Package\\PackageManager')
 
 initializeClassLoader ()
 
 unregisterClassLoader ()
 
 loadTypo3LoadedExtAndExtLocalconf ($allowCaching=TRUE)
 
 applyAdditionalConfigurationSettings ()
 
 checkValidBrowserOrDie ()
 
 populateLocalConfiguration ()
 
 disableCoreAndClassesCache ()
 
 initializeCachingFramework ()
 
 checkLockedBackendAndRedirectOrDie ()
 
 checkBackendIpOrDie ()
 
 checkSslBackendAndRedirectIfNeeded ()
 
 loadExtensionTables ($allowCaching=TRUE)
 
 initializeSpriteManager ()
 
 initializeBackendAuthentication ()
 
 initializeBackendUserMounts ()
 
 endOutputBufferingAndCleanPreviousOutput ()
 
 initializeOutputCompression ()
 
 sendHttpHeaders ()
 
 shutdown ()
 
 initializeBackendTemplate ()
 

Static Public Member Functions

static getInstance ()
 

Protected Member Functions

 __construct ($applicationContext)
 
 __clone ()
 
 initializeComposerClassLoader ()
 
 defineDatabaseConstants ()
 
 defineUserAgentConstant ()
 
 registerExtDirectComponents ()
 
 transferDeprecatedCurlSettings ()
 
 setCacheHashOptions ()
 
 setDefaultTimezone ()
 
 initializeL10nLocales ()
 
 convertPageNotFoundHandlingToBoolean ()
 
 registerGlobalDebugFunctions ()
 
 registerSwiftMailer ()
 
 configureExceptionHandling ()
 
 setMemoryLimit ()
 
 defineTypo3RequestTypes ()
 
 loadAdditionalConfigurationFromExtensions ($allowCaching=TRUE)
 
 initializeExceptionHandling ()
 
 setFinalCachingFrameworkCacheConfiguration ()
 
 defineLoggingAndExceptionConstants ()
 
 unsetReservedGlobalVariables ()
 
 executeExtTablesAdditionalFile ()
 

Protected Attributes

 $requestId
 
 $applicationContext
 
 $earlyInstances = array()
 
 $installToolPath
 
 $activeExceptionHandlerClassName
 
 $activeErrorHandlerClassName
 

Static Protected Attributes

static $instance = NULL
 

Detailed Description

This class encapsulates bootstrap related methods. It is required directly as the very first thing in entry scripts and used to define all base things like constants and pathes and so on.

Most methods in this class have dependencies to each other. They can not be called in arbitrary order. The methods are ordered top down, so a method at the beginning has lower dependencies than a method further down. Do not fiddle with the load order in own scripts except you know exactly what you are doing!

Author
Christian Kuhn lolli.nosp@m.@sch.nosp@m.warzb.nosp@m.u.ch

Definition at line 32 of file Bootstrap.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Core\Bootstrap::__construct (   $applicationContext)
protected

Definition at line 79 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Bootstrap\$applicationContext.

Member Function Documentation

◆ __clone()

TYPO3\CMS\Core\Core\Bootstrap::__clone ( )
protected

Disable direct cloning of this object.

Definition at line 87 of file Bootstrap.php.

◆ applyAdditionalConfigurationSettings()

TYPO3\CMS\Core\Core\Bootstrap::applyAdditionalConfigurationSettings ( )

Sets up additional configuration applied in all scopes

Returns
Bootstrap

Definition at line 373 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Bootstrap\initializeExceptionHandling().

◆ baseSetup()

TYPO3\CMS\Core\Core\Bootstrap::baseSetup (   $relativePathPart = '')

Run the base setup that checks server environment, determines pathes, populates base files and sets common configuration.

Script execution will be aborted if something fails here.

Parameters
string$relativePathPartRelative path of entry script back to document root
Returns
Bootstrap

Definition at line 152 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Bootstrap\initializeComposerClassLoader(), TYPO3\CMS\Core\Utility\GeneralUtility\presetApplicationContext(), TYPO3\CMS\Core\Core\SystemEnvironmentBuilder\run(), and TYPO3\CMS\Core\Core\Bootstrap\setEarlyInstance().

◆ checkBackendIpOrDie()

TYPO3\CMS\Core\Core\Bootstrap::checkBackendIpOrDie ( )

Compare client IP with IPmaskList and exit the script run if the client is not allowed to access the backend

Returns
Bootstrap

Definition at line 858 of file Bootstrap.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\GeneralUtility\cmpIP(), and TYPO3\CMS\Core\Utility\GeneralUtility\getIndpEnv().

◆ checkLockedBackendAndRedirectOrDie()

TYPO3\CMS\Core\Core\Bootstrap::checkLockedBackendAndRedirectOrDie ( )

Check adminOnly configuration variable and redirects to an URL in file typo3conf/LOCK_BACKEND or exit the script

Exceptions

Definition at line 830 of file Bootstrap.php.

References $GLOBALS, die, TYPO3\CMS\Core\Utility\GeneralUtility\getUrl(), and TYPO3_PROCEED_IF_NO_USER.

◆ checkSslBackendAndRedirectIfNeeded()

TYPO3\CMS\Core\Core\Bootstrap::checkSslBackendAndRedirectIfNeeded ( )

Check lockSSL configuration variable and redirect to https version of the backend if needed

Returns
Bootstrap

Definition at line 875 of file Bootstrap.php.

References $GLOBALS, die, TYPO3\CMS\Core\Core\Bootstrap\getEarlyInstance(), TYPO3\CMS\Core\Utility\GeneralUtility\getIndpEnv(), and TYPO3\CMS\Core\Core\Bootstrap\loadExtensionTables().

◆ checkValidBrowserOrDie()

TYPO3\CMS\Core\Core\Bootstrap::checkValidBrowserOrDie ( )

Throws an exception if no browser could be identified

Returns
Bootstrap
Exceptions

Definition at line 388 of file Bootstrap.php.

References $GLOBALS.

◆ configureExceptionHandling()

TYPO3\CMS\Core\Core\Bootstrap::configureExceptionHandling ( )
protected

Configure and set up exception and error handling

Returns
Bootstrap

Definition at line 613 of file Bootstrap.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\GeneralUtility\cmpIP(), and TYPO3\CMS\Core\Utility\GeneralUtility\getIndpEnv().

◆ convertPageNotFoundHandlingToBoolean()

TYPO3\CMS\Core\Core\Bootstrap::convertPageNotFoundHandlingToBoolean ( )
protected

Convert type of "pageNotFound_handling" setting in case it was written as a string (e.g. if edited in Install Tool)

: Remove, if the Install Tool handles such data types correctly

Returns
Bootstrap

Definition at line 576 of file Bootstrap.php.

References $GLOBALS.

◆ defineDatabaseConstants()

TYPO3\CMS\Core\Core\Bootstrap::defineDatabaseConstants ( )
protected

Define database constants

Returns

Definition at line 434 of file Bootstrap.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Core\Bootstrap\loadConfigurationAndInitialize().

◆ defineLoggingAndExceptionConstants()

TYPO3\CMS\Core\Core\Bootstrap::defineLoggingAndExceptionConstants ( )
protected

Define logging and exception constants

Returns
Bootstrap

Definition at line 732 of file Bootstrap.php.

References $GLOBALS.

◆ defineTypo3RequestTypes()

TYPO3\CMS\Core\Core\Bootstrap::defineTypo3RequestTypes ( )
protected

Define TYPO3_REQUESTTYPE* constants so devs exactly know what type of request it is

Returns
Bootstrap

Definition at line 658 of file Bootstrap.php.

References $GLOBALS, TYPO3_enterInstallScript, and TYPO3_MODE.

Referenced by TYPO3\CMS\Core\Core\Bootstrap\redirectToInstallerIfEssentialConfigurationDoesNotExist().

◆ defineUserAgentConstant()

TYPO3\CMS\Core\Core\Bootstrap::defineUserAgentConstant ( )
protected

Define user agent constant

Returns

Definition at line 451 of file Bootstrap.php.

References $GLOBALS.

◆ disableCoreAndClassesCache()

TYPO3\CMS\Core\Core\Bootstrap::disableCoreAndClassesCache ( )

Set cache_core to null backend, effectively disabling eg. the autoloader cache

Returns

Definition at line 419 of file Bootstrap.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Core\Bootstrap\loadConfigurationAndInitialize().

◆ endOutputBufferingAndCleanPreviousOutput()

TYPO3\CMS\Core\Core\Bootstrap::endOutputBufferingAndCleanPreviousOutput ( )

Throw away all output that may have happened during bootstrapping by weird extensions

Returns
Bootstrap

Definition at line 1075 of file Bootstrap.php.

◆ executeExtTablesAdditionalFile()

TYPO3\CMS\Core\Core\Bootstrap::executeExtTablesAdditionalFile ( )
protected

Execute TYPO3_extTableDef_script if defined and exists

Note: For backwards compatibility some global variables are explicitly set as global to be used without $GLOBALS[] in the extension table script. It is discouraged to access variables like $TBE_MODULES directly, but we can not prohibit this without heavily breaking backwards compatibility.

: We could write a scheduler / reports module or an update checker : It should be defined, which global arrays are ok to be manipulated

Returns
void

Definition at line 965 of file Bootstrap.php.

References $GLOBALS, $TCA, $TYPO3_CONF_VARS, and TYPO3\CMS\Core\Utility\GeneralUtility\getUserObj().

Referenced by TYPO3\CMS\Core\Core\Bootstrap\loadExtensionTables().

◆ getApplicationContext()

TYPO3\CMS\Core\Core\Bootstrap::getApplicationContext ( )

Returns the application context this bootstrap was started in.

Returns
The application context encapsulated in an object

Definition at line 126 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Bootstrap\$applicationContext.

◆ getEarlyInstance()

TYPO3\CMS\Core\Core\Bootstrap::getEarlyInstance (   $objectName)

◆ getEarlyInstances()

TYPO3\CMS\Core\Core\Bootstrap::getEarlyInstances ( )

Returns all registered early instances indexed by object name

Returns
array

Definition at line 229 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Bootstrap\$earlyInstances.

◆ getInstance()

◆ getRequestId()

TYPO3\CMS\Core\Core\Bootstrap::getRequestId ( )

Gets the request's unique ID

Returns
string Unique request ID

Definition at line 115 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Bootstrap\$requestId.

◆ initializeBackendAuthentication()

TYPO3\CMS\Core\Core\Bootstrap::initializeBackendAuthentication ( )

Initializes and ensures authenticated access

Definition at line 1038 of file Bootstrap.php.

References $GLOBALS.

◆ initializeBackendTemplate()

TYPO3\CMS\Core\Core\Bootstrap::initializeBackendTemplate ( )

Provides an instance of "template" for backend-modules to work with.

Returns
Bootstrap

Definition at line 1130 of file Bootstrap.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ initializeBackendUserMounts()

TYPO3\CMS\Core\Core\Bootstrap::initializeBackendUserMounts ( )

Initialize backend user mount points

Returns
Bootstrap

Definition at line 1050 of file Bootstrap.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ initializeCachingFramework()

TYPO3\CMS\Core\Core\Bootstrap::initializeCachingFramework ( )

◆ initializeClassLoader()

TYPO3\CMS\Core\Core\Bootstrap::initializeClassLoader ( )

◆ initializeComposerClassLoader()

TYPO3\CMS\Core\Core\Bootstrap::initializeComposerClassLoader ( )
protected
Returns

Definition at line 163 of file Bootstrap.php.

Referenced by TYPO3\CMS\Core\Core\Bootstrap\baseSetup().

◆ initializeExceptionHandling()

TYPO3\CMS\Core\Core\Bootstrap::initializeExceptionHandling ( )
protected

Initialize exception handling This method is called twice. First when LocalConfiguration has been loaded and a second time after extension ext_loclconf.php have been included to allow extensions to change the exception and error handler configuration.

Returns
Bootstrap

Definition at line 690 of file Bootstrap.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Core\Core\Bootstrap\applyAdditionalConfigurationSettings().

◆ initializeL10nLocales()

TYPO3\CMS\Core\Core\Bootstrap::initializeL10nLocales ( )
protected

Initialize the locales handled by TYPO3

Returns
Bootstrap

Definition at line 564 of file Bootstrap.php.

◆ initializeOutputCompression()

TYPO3\CMS\Core\Core\Bootstrap::initializeOutputCompression ( )

Initialize output compression if configured

Returns
Bootstrap

Definition at line 1086 of file Bootstrap.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger().

◆ initializeSpriteManager()

TYPO3\CMS\Core\Core\Bootstrap::initializeSpriteManager ( )

Initialize sprite manager

Returns
Bootstrap

Definition at line 1004 of file Bootstrap.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

◆ loadAdditionalConfigurationFromExtensions()

TYPO3\CMS\Core\Core\Bootstrap::loadAdditionalConfigurationFromExtensions (   $allowCaching = TRUE)
protected

Load extension configuration files (ext_localconf.php)

The ext_localconf.php files in extensions are meant to make changes to the global $TYPO3_CONF_VARS configuration array.

Parameters
boolean$allowCaching
Returns
Bootstrap

Definition at line 677 of file Bootstrap.php.

Referenced by TYPO3\CMS\Core\Core\Bootstrap\loadTypo3LoadedExtAndExtLocalconf().

◆ loadConfigurationAndInitialize()

TYPO3\CMS\Core\Core\Bootstrap::loadConfigurationAndInitialize (   $allowCaching = TRUE,
  $packageManagerClassName = 'TYPO3\\CMS\\Core\\Package\\PackageManager' 
)

Includes LocalConfiguration.php and sets several global settings depending on configuration.

Parameters
boolean$allowCachingWhether to allow caching - affects cache_core (autoloader)
string$packageManagerClassNameDefine an alternative package manager implementation (usually for the installer)
Returns
Bootstrap

Definition at line 242 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Bootstrap\defineDatabaseConstants(), TYPO3\CMS\Core\Core\Bootstrap\disableCoreAndClassesCache(), TYPO3\CMS\Core\Core\Bootstrap\initializeCachingFramework(), and TYPO3\CMS\Core\Core\Bootstrap\initializeClassLoader().

◆ loadExtensionTables()

TYPO3\CMS\Core\Core\Bootstrap::loadExtensionTables (   $allowCaching = TRUE)

Load ext_tables and friends.

This will mainly set up $TCA and several other global arrays through API's like extMgm. Executes ext_tables.php files of loaded extensions or the according cache file if exists.

Parameters
boolean$allowCachingTrue, if reading compiled ext_tables file from cache is allowed
Returns
Bootstrap

Definition at line 943 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Bootstrap\executeExtTablesAdditionalFile().

Referenced by TYPO3\CMS\Core\Core\Bootstrap\checkSslBackendAndRedirectIfNeeded().

◆ loadTypo3LoadedExtAndExtLocalconf()

TYPO3\CMS\Core\Core\Bootstrap::loadTypo3LoadedExtAndExtLocalconf (   $allowCaching = TRUE)

Load ext_localconf of extensions

Parameters
boolean$allowCaching
Returns
Bootstrap

Definition at line 362 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Bootstrap\loadAdditionalConfigurationFromExtensions().

◆ populateLocalConfiguration()

TYPO3\CMS\Core\Core\Bootstrap::populateLocalConfiguration ( )

We need an early instance of the configuration manager. Since makeInstance relies on the object configuration, we create it here with new instead.

Returns
Bootstrap

Definition at line 402 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Bootstrap\getEarlyInstance(), and TYPO3\CMS\Core\Core\Bootstrap\setEarlyInstance().

◆ redirectToInstallerIfEssentialConfigurationDoesNotExist()

TYPO3\CMS\Core\Core\Bootstrap::redirectToInstallerIfEssentialConfigurationDoesNotExist (   $pathUpToDocumentRoot = '')

Redirect to install tool if LocalConfiguration.php is missing.

Parameters
string$pathUpToDocumentRootCan contain '../' if called from a sub directory
Returns
Bootstrap

Definition at line 185 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Bootstrap\defineTypo3RequestTypes(), TYPO3\CMS\Core\Utility\HttpUtility\redirect(), and TYPO3\CMS\Core\Core\Bootstrap\setEarlyInstance().

◆ registerExtDirectComponents()

TYPO3\CMS\Core\Core\Bootstrap::registerExtDirectComponents ( )
protected

◆ registerGlobalDebugFunctions()

TYPO3\CMS\Core\Core\Bootstrap::registerGlobalDebugFunctions ( )
protected

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.

Returns
Bootstrap

Definition at line 591 of file Bootstrap.php.

◆ registerSwiftMailer()

TYPO3\CMS\Core\Core\Bootstrap::registerSwiftMailer ( )
protected

Mail sending via Swift Mailer

Returns
Deprecated:
since 6.1, will be removed two versions later - will be removed together with ::mail()

Definition at line 602 of file Bootstrap.php.

References $GLOBALS.

◆ sendHttpHeaders()

TYPO3\CMS\Core\Core\Bootstrap::sendHttpHeaders ( )

Send HTTP headers if configured

Returns
Bootstrap

Definition at line 1102 of file Bootstrap.php.

References $GLOBALS.

◆ setCacheHashOptions()

TYPO3\CMS\Core\Core\Bootstrap::setCacheHashOptions ( )
protected

Set cacheHash options

Returns
Bootstrap

Definition at line 523 of file Bootstrap.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ setDefaultTimezone()

TYPO3\CMS\Core\Core\Bootstrap::setDefaultTimezone ( )
protected

Set default timezone

Returns
Bootstrap

Definition at line 543 of file Bootstrap.php.

References $GLOBALS.

◆ setEarlyInstance()

TYPO3\CMS\Core\Core\Bootstrap::setEarlyInstance (   $objectName,
  $instance 
)

Registers the instance of the specified object for an early boot stage. On finalizing the Object Manager initialization, all those instances will be transferred to the Object Manager's registry.

Parameters
string$objectNameObject name, as later used by the Object Manager
object$instanceThe instance to register
Returns
void

Definition at line 206 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Bootstrap\$instance.

Referenced by TYPO3\CMS\Core\Core\Bootstrap\baseSetup(), TYPO3\CMS\Core\Core\Bootstrap\initializeCachingFramework(), TYPO3\CMS\Core\Core\Bootstrap\initializeClassLoader(), TYPO3\CMS\Core\Core\Bootstrap\populateLocalConfiguration(), TYPO3\CMS\Core\Core\Bootstrap\redirectToInstallerIfEssentialConfigurationDoesNotExist(), and TYPO3\CMS\Core\Core\Bootstrap\unregisterClassLoader().

◆ setFinalCachingFrameworkCacheConfiguration()

TYPO3\CMS\Core\Core\Bootstrap::setFinalCachingFrameworkCacheConfiguration ( )
protected

Extensions may register new caches, so we set the global cache array to the manager again at this point

Returns
Bootstrap

Definition at line 722 of file Bootstrap.php.

References $GLOBALS, and TYPO3\CMS\Core\Core\Bootstrap\getEarlyInstance().

◆ setMemoryLimit()

TYPO3\CMS\Core\Core\Bootstrap::setMemoryLimit ( )
protected

Set PHP memory limit depending on value of $GLOBALS['TYPO3_CONF_VARS']['SYS']['setMemoryLimit']

Returns
Bootstrap

Definition at line 645 of file Bootstrap.php.

References $GLOBALS.

◆ shutdown()

TYPO3\CMS\Core\Core\Bootstrap::shutdown ( )

Things that should be performed to shut down the framework. This method is called in all important scripts for a clean shut down of the system.

Returns
Bootstrap

Definition at line 1119 of file Bootstrap.php.

◆ startOutputBuffering()

TYPO3\CMS\Core\Core\Bootstrap::startOutputBuffering ( )

Prevent any unwanted output that may corrupt AJAX/compression. This does not interfere with "die()" or "echo"+"exit()" messages!

Returns
Bootstrap

Definition at line 137 of file Bootstrap.php.

◆ transferDeprecatedCurlSettings()

TYPO3\CMS\Core\Core\Bootstrap::transferDeprecatedCurlSettings ( )
protected

Parse old curl options and set new http ones instead

: Move this functionality to the silent updater in the Install Tool

Returns
Bootstrap

Definition at line 500 of file Bootstrap.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\revExplode().

◆ unregisterClassLoader()

◆ unsetReservedGlobalVariables()

TYPO3\CMS\Core\Core\Bootstrap::unsetReservedGlobalVariables ( )
protected

Unsetting reserved global variables: Those are set in "ext:core/ext_tables.php" file:

Returns
Bootstrap

Definition at line 745 of file Bootstrap.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Member Data Documentation

◆ $activeErrorHandlerClassName

TYPO3\CMS\Core\Core\Bootstrap::$activeErrorHandlerClassName
protected

Definition at line 71 of file Bootstrap.php.

◆ $activeExceptionHandlerClassName

TYPO3\CMS\Core\Core\Bootstrap::$activeExceptionHandlerClassName
protected

Definition at line 66 of file Bootstrap.php.

◆ $applicationContext

TYPO3\CMS\Core\Core\Bootstrap::$applicationContext
protected

◆ $earlyInstances

TYPO3\CMS\Core\Core\Bootstrap::$earlyInstances = array()
protected

Definition at line 56 of file Bootstrap.php.

Referenced by TYPO3\CMS\Core\Core\Bootstrap\getEarlyInstances().

◆ $installToolPath

TYPO3\CMS\Core\Core\Bootstrap::$installToolPath
protected

Definition at line 61 of file Bootstrap.php.

◆ $instance

TYPO3\CMS\Core\Core\Bootstrap::$instance = NULL
staticprotected

Definition at line 37 of file Bootstrap.php.

Referenced by TYPO3\CMS\Core\Core\Bootstrap\setEarlyInstance().

◆ $requestId

TYPO3\CMS\Core\Core\Bootstrap::$requestId
protected

Definition at line 44 of file Bootstrap.php.

Referenced by TYPO3\CMS\Core\Core\Bootstrap\getRequestId().