BootstrappingΒΆ
Bootstrapping basically happens in 3 parts:
- Analysis of the environment
- Reading the configuration
- Firering up the global tool chain: DB, Caching, etc.
Running typo3/index.php
:
* require vendor/autoload.php
* This file is generated by composer to find all classes.
* It is configurated by different composer.json files.
* new Frontend\Http\Application
* bootstrap = Core\Bootstrap\getInstance (calls __construct)
* getenv TYPO3_CONTEXT ?: REDIRECT_TYPO3_CONTEXT ?: "Production"
* new Core\ApplicationContext
* A TYPO3 Application context is something like "Production", "Development",
* "Production/StagingSystem", and is set using the TYPO3_CONTEXT environment variable.
* Mainly, you will use $context->isProduction(), $context->isTesting() and
* $context->isDevelopment() inside your custom code.
* defineTypo3RequestTypes
- TYPO3_REQUESTTYPE_FE
- TYPO3_REQUESTTYPE_BE
- TYPO3_REQUESTTYPE_CLI
- TYPO3_REQUESTTYPE_AJAX
- TYPO3_REQUESTTYPE_INSTALL
* bootstrap->initializeClassLoader
registers the classloader as an "early instance"
* bootstrap->setRequestType
- TYPO3_REQUESTTYPE: one of the above
* bootstrap->baseSetup
* SystemEnvironmentBuilder::run
* defineBaseConstants
- version info
- external links
- NUL, TAB, LF, CR, SUB, CRLF
- security
- OS
- errors
* definePaths
- TYPO3_mainDir
- PATH_thisScript
- PATH_site
- PATH_typo3
- PATH_typo3conf
* checkMainPathsExist
- .../sysext
* initializeGlobalVariables
reset $GLOBALS: error, TYPO3_MISC, T3_VAR, T3_SERVICES
* initializeGlobalTimeTrackingVariables
- variables for time tracking, logging, etc.
* initializeBasicErrorReporting
error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED));
* GeneralUtility::presetApplicationContext
sets GeneralUtility::applicationContext
* bootstrap->checkIfEssentialConfigurationExists
* new Core\Configuration\ConfigurationManager
register as "early instance"
(rather ugly side effect!)
* check for
- LocalConfiguration.php (cm->getLocalConfigurationFileLocation)
- PATH_typo3conf . PackageStates.php
* or bootstrap->redirectToInstallTool
* loop bootstrap->registerRequestHandlerImplementation
- Frontend\Http\RequestHandler
- Frontend\Http\EidRequestHandler
* bootstrap->configure
* startOutputBuffering
ob_start
* loadConfigurationAndInitialize
* populateLocalConfiguration
* initializeErrorHandling
* optionally disableCoreCache
* initializeCachingFramework
* initializePackageManagement
* initializeRuntimeActivatedPackagesFromConfiguration
* defineUserAgentConstant
* registerExtDirectComponents
* setCacheHashOptions
* setDefaultTimezone
* initializeL10nLocales
* convertPageNotFoundHandlingToBoolean
* setMemoryLimit
* optionally: ensureClassLoadingInformationExists
* loadTypo3LoadedExtAndExtLocalconf
* ExtensionManagementUtility::loadExtLocalconf
* setFinalCachingFrameworkCacheConfiguration
* CacheManager->setCacheConfigurations:
$TYPO3_CONF_VARS.SYS.caching.cacheConfigurations
* defineLoggingAndExceptionConstants
This constants are set from variables!!!
- TYPO3_DLOG: $TYPO3_CONF_VARS.SYS.enable_DLOG
- TYPO3_ERROR_DLOG: $TYPO3_CONF_VARS.SYS.enable_errorDLOG
- TYPO3_EXCEPTION_DLOG: $TYPO3_CONF_VARS.SYS.enable_exceptionDLOG
* unsetReservedGlobalVariables
* Unsetting reserved global variables:
* Those are set in "ext:core/ext_tables.php" file or otherwise:
- PAGES_TYPES
- TCA
- TBE_MODULES
- TBE_STYLES
- BE_USER
- TBE_MODULES_EXT
- TCA_DESCR
- LOCAL_LANG
* initializeTypo3DbGlobal
* creates Core\Database\DatabaseConnection
* configures it in a complex process
* This includes:
$TYPO3_CONF_VARS.DB.Connections.Default.persistentConnection
* Set it to $TYPO3_DB
* $TYPO3_DB->initialize
Delegated to DBAL
* ->run