Project

General

Profile

Actions

Feature #95895

open

Create an Installation/TYPO3_CONTEXT scoped possibility to amend DI / Service.yaml Configuration

Added by Frank Berger over 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2021-11-06
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

Any Configuration in TCA or TYPO3_CONF_VARS can be overridden or amended in LocalConfiguration.php or AdditionalConfiguration.php

A lot of base packages use that to additionally override Configuration Settings based on the TYPO3_CONTEXT environment variable.

While not exactly the same, this being a runtime configuration, it would be great to have a similar possibility for Services.yaml

It is possible already to add a Services.yaml to override DI Configurations in another Extension, like a Site-package. But there are several use cases where configuration is dependant on the Context or Installation.

Think about Test cases, Developer Tools provided by extensions, or other local configuration, which would want to override DI Configurations. There are numerous cases and extensions which do not involve Frontend or Site-packages. A extension could provide a standard way to do things and a case-dependent way in certain scenarios. Which is not really possible today, besides creating another extension (or site-package)

Like Injecting as Mocked Repository or Model in a Test case, or a different Formatter of a CLI Tool in Development on the local machine (the later which is my usecase)

I propose another directory in the config directory where the site config resided (where a classic Symfony application would keep its config files) wherein for example a services folder could reside with a Production.yaml or any other TYPO3_CONTEXT derived yaml file could reside which is loaded based on the TYPO3_CONTEXT in
TYPO3\CMS\Core\DependencyInjection\ContainerBuilder before line 145 where $containerBuilder->compile(); is called.

This would enable to override DI configurations at compile time based on Context and Installation.

No data to display

Actions

Also available in: Atom PDF