Feature #95895
closedCreate an Installation/TYPO3_CONTEXT scoped possibility to amend DI / Service.yaml Configuration
0%
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.