Feature #97991
openAllow unset variables in site configuration
0%
Description
USE CASE:
I had a site config with %env(ENV_NAME_AS_SUFFIX)%
and we thought we could define the env only when needed. It turned out that TYPO3 doesn't like undefined variables.
Having also worked with shell variable expansion (adopted in eg. docker compose files and Gitlab configuration files), I'd appreciated if I could use an undefined variable without breaking the site configuration.
SUGGESTION:
Use another syntax borrowed from Symfony: %env(fallback:<fallback_value>:ENV_NAME)%
.
This allows for unset variables and has a fallback value as a bonus.
See https://symfony.com/doc/current/configuration/env_var_processors.html
PS:
Other formats that might be of use in a site configration are IMHO env(bool:FOO)
, env(not:FOO)
, env(int:FOO)
and env(float:FOO)
.
Updated by Gerrit Code Review 10 days ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86972