Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (40 sloc) 2 KB

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:

<?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/

Configuration

Context examples

TYPO3_CONTEXT=Production (default):

  • typo3conf/AdditionalConfiguration/Production.php
  • typo3conf/AdditionalConfiguration/Local.php

TYPO3_CONTEXT=Testing (eg. for Unit tests):

  • typo3conf/AdditionalConfiguration/Testing.php
  • typo3conf/AdditionalConfiguration/Local.php

TYPO3_CONTEXT=Development (for development):

  • typo3conf/AdditionalConfiguration/Development.php
  • typo3conf/AdditionalConfiguration/Local.php

TYPO3_CONTEXT=Development/Docker (for development inside TYPO3 docker boilerplate):

  • typo3conf/AdditionalConfiguration/Development.php
  • typo3conf/AdditionalConfiguration/Development/Docker.php
  • typo3conf/AdditionalConfiguration/Local.php

TYPO3_CONTEXT=Production/Preview (for preview):

  • typo3conf/AdditionalConfiguration/Development.php
  • typo3conf/AdditionalConfiguration/Development/Preview.php
  • typo3conf/AdditionalConfiguration/Local.php

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

Extension configuration

You can also manipulate extension configuration in Context files:

<?php
\WebDevOps\ContextLoader\ContextLoader::getInstance()
    ->setExtensionConfiguration('metaseo', 'fookey', 'barvalue');
    ->setExtensionConfigurationList('metaseo', [
        'fookey1' => 'barval1',
        'fookey2' => 'barval2',
    ]);
You can’t perform that action at this time.