Issue Feature Closed

#89410Placeholders for YAML import statement

Grigory Rechkin 10/14/19, 13:38 updated 01/14/20, 21:03

Description

Regarding this concept:
https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/SiteHandling/UsingEnvVars.html
https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/core/Classes/Configuration/Loader/YamlFileLoader.php

It seems not possible to use an environment variable in an imports block.

Description:
The main idea that installing TYPO3 via composer creates “public” folder (that should be an entry point for a web server) and “config” folder (with sites yaml configuration) on the same level. Import starts search from a server root directory so I can’t get into that config folder by relative path. Using something like %env(TYPO3_PATH_APP)%/config/includes/<filename> should do the trick but it is not replaced by the environment variable in the import block as in the other places.</filename>

Solution:
Swap the order of processPlaceholders (first) and processImports (second) in the load function so it will replace before import. Since processImports calls the same load function and processes the placeholders in the including file it will also prevent the second placeholder convert on the same content.

Impact:
Current configurations should work as is, imports block should support placeholders/environment variables

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.