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.
Updated by Georg Ringer about 2 months ago
- Status changed from New to Needs Feedback
is https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.1/Feature-98912-Installation-wide-ServicesConfiguration.html of #98912 enough for you?
you could switch the service.yaml in your build pipeline or use the service.php and check the context there
Updated by Georg Ringer about 2 months ago
- Status changed from Needs Feedback to Closed
related feature works for issue author