‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Core\Bootstrap Class Reference

Static Public Member Functions

static init (ClassLoader $classLoader, bool $failsafe=false)
 
static startOutputBuffering ()
 
static baseSetup ()
 
static initializeClassLoader (ClassLoader $classLoader)
 
static bool checkIfEssentialConfigurationExists (ConfigurationManager $configurationManager)
 
static createPackageManager ($packageManagerClassName, PackageCacheInterface $packageCache)
 
static createPackageCache (FrontendInterface $coreCache)
 
static createConfigurationManager ()
 
static createCache (string $identifier, bool $disableCaching=false)
 
static unsetReservedGlobalVariables ()
 
static loadExtTables (bool $allowCaching=true, FrontendInterface $coreCache=null)
 
static initializeBackendUser ($className=BackendUserAuthentication::class, ServerRequestInterface $request=null)
 
static initializeBackendAuthentication ()
 

Static Protected Member Functions

static populateLocalConfiguration (ConfigurationManager $configurationManager)
 
static setDefaultTimezone ()
 
static initializeErrorHandling ()
 
static setMemoryLimit ()
 
static checkEncryptionKey ()
 

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 paths 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!

Definition at line 61 of file Bootstrap.php.

Member Function Documentation

◆ baseSetup()

static TYPO3\CMS\Core\Core\Bootstrap::baseSetup ( )
static

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

Script execution will be aborted if something fails here.

This is not a public API method, do not use in own extensions

Definition at line 180 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\ClassLoadingInformation\isClassLoadingInformationAvailable(), TYPO3\CMS\Core\Core\Environment\isComposerMode(), and TYPO3\CMS\Core\Core\ClassLoadingInformation\registerClassLoadingInformation().

◆ checkEncryptionKey()

static TYPO3\CMS\Core\Core\Bootstrap::checkEncryptionKey ( )
staticprotected

Check if a configuration key has been configured

Definition at line 474 of file Bootstrap.php.

References $GLOBALS.

◆ checkIfEssentialConfigurationExists()

static bool TYPO3\CMS\Core\Core\Bootstrap::checkIfEssentialConfigurationExists ( ConfigurationManager  $configurationManager)
static

checks if config/system/settings.php or PackageStates.php is missing, used to see if a redirect to the installer is needed

All file_exists checks are delayed as far as possible to avoid I/O impact

Returns
‪bool TRUE when the essential configuration is available, otherwise FALSE

This is not a public API method, do not use in own extensions

Definition at line 214 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Environment\getLegacyConfigPath(), and TYPO3\CMS\Core\Core\Environment\isComposerMode().

Referenced by TYPO3\CMS\Core\Http\Application\handle(), and TYPO3\CMS\Core\Console\CommandApplication\run().

◆ createCache()

static TYPO3\CMS\Core\Core\Bootstrap::createCache ( string  $identifier,
bool  $disableCaching = false 
)
static

Instantiates an early cache instance

Creates a cache instances independently from the CacheManager. The is used to create the core cache during early bootstrap when the CacheManager is not yet available (i.e. configuration is not yet loaded).

Parameters
string$identifier
bool$disableCaching

Definition at line 335 of file Bootstrap.php.

References $GLOBALS, and TYPO3\CMS\Webhooks\Message\$identifier.

Referenced by TYPO3\CMS\Core\Database\Schema\SchemaMigrator\migrate(), and TYPO3\CMS\Core\Core\BootService\prepareContainer().

◆ createConfigurationManager()

static TYPO3\CMS\Core\Core\Bootstrap::createConfigurationManager ( )
static

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

Definition at line 308 of file Bootstrap.php.

◆ createPackageCache()

static TYPO3\CMS\Core\Core\Bootstrap::createPackageCache ( FrontendInterface  $coreCache)
static

◆ createPackageManager()

static TYPO3\CMS\Core\Core\Bootstrap::createPackageManager (   $packageManagerClassName,
PackageCacheInterface  $packageCache 
)
static

Initializes the package system and loads the package configuration and settings provided by the packages.

Parameters
string$packageManagerClassName‪Define an alternative package manager implementation (usually for the installer)

This is not a public API method, do not use in own extensions

Definition at line 276 of file Bootstrap.php.

◆ init()

static TYPO3\CMS\Core\Core\Bootstrap::init ( ClassLoader  $classLoader,
bool  $failsafe = false 
)
static

Bootstrap TYPO3 and return a Container that may be used to initialize an Application class.

Parameters
ClassLoader$classLoader‪an instance of the class loader
bool$failsafe‪true if no caching and a failsafe package manager should be used

Definition at line 70 of file Bootstrap.php.

References $GLOBALS, TYPO3\CMS\Core\Core\Environment\getContext(), TYPO3\CMS\Core\Core\ClassLoadingInformation\isClassLoadingInformationAvailable(), TYPO3\CMS\Core\Core\Environment\isComposerMode(), TYPO3\CMS\Core\Core\ClassLoadingInformation\registerClassLoadingInformation(), and TYPO3\CMS\Core\Utility\ExtensionManagementUtility\setPackageManager().

◆ initializeBackendAuthentication()

◆ initializeBackendUser()

static TYPO3\CMS\Core\Core\Bootstrap::initializeBackendUser (   $className = BackendUserAuthentication::class,
ServerRequestInterface  $request = null 
)
static

Initialize backend user object in globals

Parameters
string$className‪usually \TYPO3\CMS\Core\Authentication\BackendUserAuthentication::class but can be used for CLI
ServerRequestInterface | null$request

This is not a public API method, do not use in own extensions

Definition at line 512 of file Bootstrap.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Install\Command\UpgradeWizardListCommand\bootstrap(), TYPO3\CMS\Install\Command\UpgradeWizardRunCommand\bootstrap(), TYPO3\CMS\Core\Tests\Acceptance\Support\Extension\ApplicationEnvironment\bootstrapTypo3Environment(), and TYPO3\CMS\Core\Console\CommandApplication\run().

◆ initializeClassLoader()

static TYPO3\CMS\Core\Core\Bootstrap::initializeClassLoader ( ClassLoader  $classLoader)
static

Sets the class loader to the bootstrap

Parameters
ClassLoader$classLoader‪an instance of the class loader

This is not a public API method, do not use in own extensions

Definition at line 193 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\ClassLoadingInformation\setClassLoader().

◆ initializeErrorHandling()

static TYPO3\CMS\Core\Core\Bootstrap::initializeErrorHandling ( )
staticprotected

Configure and set up exception and error handling

Exceptions

Definition at line 395 of file Bootstrap.php.

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

◆ loadExtTables()

static TYPO3\CMS\Core\Core\Bootstrap::loadExtTables ( bool  $allowCaching = true,
FrontendInterface  $coreCache = null 
)
static

Load ext_tables and friends.

This will mainly load and execute ext_tables.php files of loaded extensions or the according cache file if exists.

Parameters
bool$allowCaching‪True, if reading compiled ext_tables file from cache is allowed

This is not a public API method, do not use in own extensions

Todo:
‪: It would be better to remove this method and use the factory directly. Needs a pre-patch in testing-framework.

Definition at line 495 of file Bootstrap.php.

Referenced by TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator\process(), and TYPO3\CMS\Backend\Middleware\BackendRouteInitialization\process().

◆ populateLocalConfiguration()

static TYPO3\CMS\Core\Core\Bootstrap::populateLocalConfiguration ( ConfigurationManager  $configurationManager)
staticprotected

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

This is not a public API method, do not use in own extensions

Definition at line 319 of file Bootstrap.php.

◆ setDefaultTimezone()

static TYPO3\CMS\Core\Core\Bootstrap::setDefaultTimezone ( )
staticprotected

Set default timezone

Definition at line 374 of file Bootstrap.php.

References $GLOBALS.

◆ setMemoryLimit()

static TYPO3\CMS\Core\Core\Bootstrap::setMemoryLimit ( )
staticprotected

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

Definition at line 452 of file Bootstrap.php.

References $GLOBALS.

◆ startOutputBuffering()

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

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

This is not a public API method, do not use in own extensions

Definition at line 167 of file Bootstrap.php.

◆ unsetReservedGlobalVariables()

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

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

This is not a public API method, do not use in own extensions

Definition at line 465 of file Bootstrap.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Core\BootService\loadExtLocalconfDatabaseAndExtTables().