Project

General

Profile

Actions

Feature #97991

open

Allow unset variables in site configuration

Added by Martin Kutschker almost 2 years ago.

Status:
New
Priority:
Could have
Assignee:
-
Category:
-
Target version:
-
Start date:
2022-07-21
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

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

No data to display

Actions

Also available in: Atom PDF