@@ -598,13 +598,10 @@ configure options that depend on where the application is run (e.g. the database
598
598
credentials are usually different in production versus your local machine). If
599
599
the values are sensitive, you can even :doc: `encrypt them as secrets </configuration/secrets >`.
600
600
601
- You can reference environment variables using the special syntax
602
- ``%env(ENV_VAR_NAME)% ``. The values of these options are resolved at runtime
603
- (only once per request, to not impact performance).
604
-
605
- Note that not all config options are compatible with environment variables. There are
606
- `cases <https://github.com/symfony/symfony/issues/39902 >`_ which may require refactoring
607
- the config definition in order to work with environment variables.
601
+ Use the special syntax ``%env(ENV_VAR_NAME)% `` to reference environment variables.
602
+ The values of these options are resolved at runtime (only once per request, to
603
+ not impact performance) so you can change the application behavior without having
604
+ to clear the cache.
608
605
609
606
This example shows how you could configure the database connection using an env var:
610
607
@@ -677,6 +674,14 @@ To define the value of an env var, you have several options:
677
674
Some hosts - like SymfonyCloud - offer easy `utilities to manage env vars `_
678
675
in production.
679
676
677
+ .. note ::
678
+
679
+ Some configuration features are not compatible with env vars. For example,
680
+ defining some container parameters conditionally based on the existence of
681
+ another configuration option. When using an env var, the configuration option
682
+ always exists, because its value will be ``null `` when the related env var
683
+ is not defined.
684
+
680
685
.. caution ::
681
686
682
687
Beware that dumping the contents of the ``$_SERVER `` and ``$_ENV `` variables
0 commit comments