Issue Feature Under Review Orphaned

#97991Allow unset variables in site configuration

Martin Kutschker 07/21/22, 13:25 updated 11/12/24, 10:44

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) .

Reviews 1

History 01