Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294253

Support setting service parameters via environment variables

$
0
0

Problem/Motivation

The symfony container allows to define service parameters from environment variables. (Symfony documentation on configuration and Environment Variable Processors)
However this does not work with Drupal.

Steps to reproduce

Add a service parameter like this:

parameters:
  twig.config:
    debug: '%env(bool:MY_TWIG_DEBUG_ENV_VARIABLE)%'

And observe the error:

In ParameterBag.php line 100:
                                                                                                                    
  The parameter "twig.config" has a dependency on a non-existent parameter "env(bool:MY_TWIG_DEBUG_ENV_VARIABLE)".  

Proposed resolution

Use the EnvPlaceholderParameterBag and make sure environment variables are replaced correctly.

Remaining tasks

User interface changes

none

API changes

Support for environment variables in service parameters.

Data model changes

none

Release notes snippet

tbd


Viewing all articles
Browse latest Browse all 294253

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>