Bug #89398
Updated by Stig Nørgaard Færch about 5 years ago
The docs describe (https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/SiteHandling/UsingEnvVars.html) the possibility of using environment variables placeholders in YAML configuration files.
It works fine expect on imports definitions, as it is processed before the placeholders. On simple addition, would fix this though.
The use case for us, is that we set a custom environment variable CONFIG_KEY which will load a specific YAML file, depending on the value.
<pre>
Index: staging3s/public/typo3/sysext/core/Classes/Configuration/Loader/YamlFileLoader.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- staging/public/typo3/sysext/core/Classes/Configuration/Loader/YamlFileLoader.php (date 1570787062004)
+++ staging/public/typo3/sysext/core/Classes/Configuration/Loader/YamlFileLoader.php (date 1570787062004)
@@ -112,6 +112,7 @@
{
if (isset($content['imports']) && is_array($content['imports'])) {
foreach ($content['imports'] as $import) {
+ $import = $this->processPlaceholders($import, $import);
$importedContent = $this->load($import['resource']);
// override the imported content with the one from the current file
$content = $this->merge($importedContent, $content);
</pre>