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

Static Public Member Functions

static ContainerInterface init (ClassLoader $classLoader, bool $failsafe=false)
 
static startOutputBuffering ()
 
static baseSetup ()
 
static initializeClassLoader (ClassLoader $classLoader)
 
static PackageManager createPackageManager ($packageManagerClassName, FrontendInterface $coreCache)
 
static loadTypo3LoadedExtAndExtLocalconf ($allowCaching=true, FrontendInterface $coreCache=null)
 
static ConfigurationManager createConfigurationManager ()
 
static FrontendInterface createCache (string $identifier, bool $disableCaching=false)
 
static unsetReservedGlobalVariables ()
 
static loadBaseTca (bool $allowCaching=true, FrontendInterface $coreCache=null)
 
static loadExtTables (bool $allowCaching=true)
 
static initializeBackendRouter ()
 
static initializeBackendUser ($className=BackendUserAuthentication::class)
 
static initializeBackendAuthentication ($proceedIfNoUserIsLoggedIn=false)
 
static initializeLanguageObject ()
 

Static Protected Member Functions

static bool checkIfEssentialConfigurationExists (ConfigurationManager $configurationManager)
 
static initializeRuntimeActivatedPackagesFromConfiguration (PackageManager $packageManager)
 
static populateLocalConfiguration (ConfigurationManager $configurationManager)
 
static setDefaultTimezone ()
 
static initializeErrorHandling ()
 
static initializeBasicErrorReporting ()
 
static initializeIO ()
 
static setMemoryLimit ()
 
static checkEncryptionKey ()
 
static runExtTablesPostProcessingHooks ()
 

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 65 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.

Exceptions

Definition at line 189 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 527 of file Bootstrap.php.

References $GLOBALS.

◆ checkIfEssentialConfigurationExists()

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

checks if LocalConfiguration.php or PackageStates.php is missing, used to see if a redirect to the install tool is needed

Parameters
ConfigurationManager$configurationManager
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 228 of file Bootstrap.php.

References TYPO3\CMS\Core\Core\Environment\getLegacyConfigPath().

◆ createCache()

static FrontendInterface 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
Returns
‪FrontendInterface

Definition at line 321 of file Bootstrap.php.

References $GLOBALS.

◆ createConfigurationManager()

static ConfigurationManager 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.

Returns
‪ConfigurationManager

Definition at line 292 of file Bootstrap.php.

◆ createPackageManager()

static PackageManager TYPO3\CMS\Core\Core\Bootstrap::createPackageManager (   $packageManagerClassName,
FrontendInterface  $coreCache 
)
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)
FrontendInterface$coreCache
Returns
‪PackageManager

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

Definition at line 243 of file Bootstrap.php.

◆ init()

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

◆ initializeBackendAuthentication()

◆ initializeBackendRouter()

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

Initialize the Routing for the TYPO3 Backend Loads all routes registered inside all packages and stores them inside the Router

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

Deprecated:
‪this does not do anything anymore, as TYPO3's dependency injection already loads the routes on demand.

Definition at line 579 of file Bootstrap.php.

◆ initializeBackendUser()

static TYPO3\CMS\Core\Core\Bootstrap::initializeBackendUser (   $className = BackendUserAuthentication::class)
static

Initialize backend user object in globals

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

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

Definition at line 591 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\BackendCoreEnvironment\bootstrapTypo3Environment(), TYPO3\CMS\Core\Console\CommandRequestHandler\handleRequest(), and TYPO3\CMS\Core\Console\CommandApplication\run().

◆ initializeBasicErrorReporting()

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

Initialize basic error reporting.

There are a lot of extensions that have no strict / notice / deprecated free ext_localconf or ext_tables. Since the final error reporting must be set up after those extension files are read, a default configuration is needed to suppress error reporting meanwhile during further bootstrap.

Please note: if you comment out this code, TYPO3 would never set any error reporting which would need to have TYPO3 Core and ALL used extensions to be notice free and deprecation free. However, commenting this out and running functional and acceptance tests shows what needs to be done to make TYPO3 Core mostly notice-free (unit tests do not execute this code here).

Definition at line 450 of file Bootstrap.php.

◆ 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 205 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 381 of file Bootstrap.php.

References $GLOBALS.

◆ initializeIO()

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

Initializes IO and stream wrapper related behavior.

Definition at line 459 of file Bootstrap.php.

◆ initializeLanguageObject()

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

Initialize language object

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

Definition at line 617 of file Bootstrap.php.

References $GLOBALS, and TYPO3\CMS\Core\Localization\LanguageService\createFromUserPreferences().

Referenced by TYPO3\CMS\Core\Tests\Acceptance\Support\Extension\BackendCoreEnvironment\bootstrapTypo3Environment(), TYPO3\CMS\Backend\Tests\Functional\Form\FormDataProvider\TcaGroupTest\setUp(), TYPO3\CMS\Workspaces\Tests\Functional\Service\WorkspaceServiceTest\setUp(), TYPO3\CMS\Backend\Tests\Functional\Domain\Repository\Localization\LocalizationRepositoryTest\setUp(), TYPO3\CMS\Backend\Tests\Functional\View\PageLayoutViewTest\setUp(), TYPO3\CMS\Recycler\Tests\Functional\Recycle\AbstractRecycleTestCase\setUp(), TYPO3\CMS\Backend\Tests\Functional\Controller\FormInlineAjaxControllerTest\setUp(), TYPO3\CMS\Core\Tests\Functional\DataHandling\Regular\Hooks\PagesTsConfigGuardTest\setUp(), TYPO3\CMS\Core\Tests\Functional\DataHandling\DataHandler\SecurityTest\setUp(), TYPO3\CMS\Backend\Tests\Functional\Controller\EditDocumentControllerTest\setUp(), TYPO3\CMS\Impexp\Tests\Functional\AbstractImportExportTestCase\setUp(), TYPO3\CMS\Workspaces\Tests\Functional\Hook\DataHandlerHookTest\setUp(), TYPO3\CMS\Form\Tests\Functional\Hooks\FormFileExtensionUpdateTest\setUp(), TYPO3\CMS\Linkvalidator\Tests\Functional\Repository\BrokenLinkRepositoryTest\setUp(), TYPO3\CMS\Core\Tests\Functional\DataHandling\AbstractDataHandlerActionTestCase\setUp(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\EidRequestTest\setUpDatabase(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SiteRequestTest\setUpDatabase(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteRequestTest\setUpDatabase(), TYPO3\CMS\Backend\Tests\Functional\View\BackendLayout\Drawing\BackendLayoutRendererTest\setUpDatabase(), TYPO3\CMS\Backend\Tests\Functional\Clipboard\ClipboardTest\setUpDatabase(), TYPO3\CMS\Core\Tests\Functional\Utility\RootlineUtilityTest\setUpDatabase(), TYPO3\CMS\Backend\Tests\Functional\Controller\Page\TreeControllerTest\setUpDatabase(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\TypoLinkGeneratorTest\setUpDatabase(), TYPO3\CMS\FluidStyledContent\Tests\Functional\Rendering\SecureHtmlRenderingTest\setUpDatabase(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\EnhancerSiteRequestTest\setUpDatabase(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\EnhancerLinkGeneratorTest\setUpDatabase(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugLinkGeneratorTest\setUpDatabase(), TYPO3\CMS\Form\Tests\Functional\RequestHandling\AbstractRequestHandlingTest\setUpDatabase(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\MountPointTest\setUpDatabase(), TYPO3\CMS\Core\Tests\Functional\Routing\Aspect\PersistedAliasMapperTest\setUpDatabase(), TYPO3\CMS\Core\Tests\Functional\Routing\Aspect\PersistedPatternMapperTest\setUpDatabase(), TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\LocalizedPageRendering\AbstractLocalizedPagesTestCase\setUpDatabaseWithYamlPayload(), TYPO3\CMS\Seo\Tests\Functional\HrefLang\HrefLangGeneratorTest\setUpDatabaseWithYamlPayload(), and TYPO3\CMS\Frontend\Tests\Functional\SiteHandling\SlugSiteWithoutRequiredCHashRequestTest\withDatabaseSnapshot().

◆ initializeRuntimeActivatedPackagesFromConfiguration()

static TYPO3\CMS\Core\Core\Bootstrap::initializeRuntimeActivatedPackagesFromConfiguration ( PackageManager  $packageManager)
staticprotected

Activates a package during runtime. This is used in AdditionalConfiguration.php to enable extensions under conditions.

Parameters
PackageManager$packageManager

Definition at line 260 of file Bootstrap.php.

References $GLOBALS.

◆ loadBaseTca()

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

Load $TCA

This will mainly set up $TCA through extMgm API.

Parameters
bool$allowCaching‪True, if loading TCA from cache is allowed
FrontendInterface$coreCache

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

Definition at line 516 of file Bootstrap.php.

References TYPO3\CMS\Core\Utility\ExtensionManagementUtility\loadBaseTca().

Referenced by TYPO3\CMS\Install\Service\LateBootService\loadExtLocalconfDatabaseAndExtTables(), TYPO3\CMS\FrontendLogin\Tests\Functional\Tca\ContentVisibleFieldsTest\piBaseLoginFormContainsExpectedFields(), and TYPO3\CMS\Extensionmanager\Utility\InstallUtility\reloadCaches().

◆ loadExtTables()

static TYPO3\CMS\Core\Core\Bootstrap::loadExtTables ( bool  $allowCaching = true)
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

Definition at line 546 of file Bootstrap.php.

References TYPO3\CMS\Core\Utility\ExtensionManagementUtility\loadExtTables().

Referenced by TYPO3\CMS\Core\Console\CommandRequestHandler\handleRequest(), TYPO3\CMS\Install\Service\LateBootService\loadExtLocalconfDatabaseAndExtTables(), TYPO3\CMS\Backend\Middleware\BackendRouteInitialization\process(), TYPO3\CMS\Frontend\Middleware\BackendUserAuthenticator\process(), TYPO3\CMS\Extensionmanager\Utility\InstallUtility\reloadCaches(), and TYPO3\CMS\Core\Console\CommandApplication\run().

◆ loadTypo3LoadedExtAndExtLocalconf()

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

Load ext_localconf of extensions

Parameters
bool$allowCaching
FrontendInterface$coreCache

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

Definition at line 278 of file Bootstrap.php.

References TYPO3\CMS\Core\Utility\ExtensionManagementUtility\loadExtLocalconf().

Referenced by TYPO3\CMS\Install\Service\LateBootService\loadExtLocalconfDatabaseAndExtTables().

◆ 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.

Parameters
ConfigurationManager$configurationManager

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

Definition at line 304 of file Bootstrap.php.

◆ runExtTablesPostProcessingHooks()

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

Check for registered ext tables hooks and run them

Exceptions

Definition at line 557 of file Bootstrap.php.

References $GLOBALS.

◆ setDefaultTimezone()

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

Set default timezone

Definition at line 360 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 481 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 175 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 494 of file Bootstrap.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Install\Service\LateBootService\loadExtLocalconfDatabaseAndExtTables().