Project

General

Profile

Actions

Feature #97991

open

Allow unset variables in site configuration

Added by Martin Kutschker over 2 years ago. Updated 10 days ago.

Status:
Under Review
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) .

Actions #1

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

Actions

Also available in: Atom PDF