WebDevOps TYPO3 context configuration loader (TYPO3_CONTEXT)
Installation
Install this extension via composer
or TYPO3-TER and add following snippet to your typo3conf/AdditionalConfiguration.php
:, (*1)
<?php
defined('TYPO3_MODE') || exit('Access denied.');
require_once __DIR__ . '/ext/context_loader/ContextInit.php';
As example configuration copy EXT:context_loader/Examples/
to typo3conf/AdditionalConfiguration/
, (*2)
Configuration
Context examples
TYPO3_CONTEXT=Production (default):
- typo3conf/AdditionalConfiguration/Production.php
- typo3conf/AdditionalConfiguration/Local.php
, (*3)
TYPO3_CONTEXT=Testing (eg. for Unit tests):
- typo3conf/AdditionalConfiguration/Testing.php
- typo3conf/AdditionalConfiguration/Local.php
, (*4)
TYPO3_CONTEXT=Development (for development):
- typo3conf/AdditionalConfiguration/Development.php
- typo3conf/AdditionalConfiguration/Local.php
, (*5)
TYPO3_CONTEXT=Development/Docker (for development inside TYPO3 docker boilerplate):
- typo3conf/AdditionalConfiguration/Development.php
- typo3conf/AdditionalConfiguration/Development/Docker.php
- typo3conf/AdditionalConfiguration/Local.php
, (*6)
TYPO3_CONTEXT=Production/Preview (for preview):
- typo3conf/AdditionalConfiguration/Development.php
- typo3conf/AdditionalConfiguration/Development/Preview.php
- typo3conf/AdditionalConfiguration/Local.php
, (*7)
TYPO3_CONTEXT=Production/Live/Server4711 (specific live server configuration):
- typo3conf/AdditionalConfiguration/Development.php
- typo3conf/AdditionalConfiguration/Development/Live.php
- typo3conf/AdditionalConfiguration/Development/Live/Server123.php
- typo3conf/AdditionalConfiguration/Local.php
, (*8)
Extension configuration
You can also manipulate extension configuration in Context files:, (*9)
<?php
\WebDevOps\ContextLoader\ContextLoader::getInstance()
->setExtensionConfiguration('metaseo', 'fookey', 'barvalue');
->setExtensionConfigurationList('metaseo', [
'fookey1' => 'barval1',
'fookey2' => 'barval2',
]);