Skip to content

Commit 696827c

Browse files
committed
Minor reword
1 parent 4f8ddfe commit 696827c

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

components/dependency_injection/compilation.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -618,15 +618,19 @@ have the cache will be considered stale.
618618
Resolving Environment Variable At Compile Time
619619
----------------------------------------------
620620

621-
Environment variables value can be resolved at compile time by using the following code::
621+
.. caution::
622+
623+
**This practice is discouraged**. Use it only if you fully understand the implications.
624+
625+
By default, environment variables are resolved at runtime. However, you can
626+
force their resolution at compile time using the following code::
622627

623628
$parameterValue = $container->resolveEnvPlaceholders(
624629
$container->getParameter('%env(ENV_VAR_NAME)%'),
625-
true // Resolve to actual values
630+
true // resolve to actual values
626631
);
627632

628-
.. warning::
629-
630-
Environment variables are usually a runtime concern. One of the major drawbacks of resolving them
631-
at compile time is that you'll need to manually clear the cache when changing their value (which is exactly
632-
what you don't have to do for env vars under normal circumstances).
633+
However, a **major drawback** of this approach is that you must manually clear
634+
the cache when changing the value of an environment variable. This goes
635+
against the typical behavior of environment variables, which are designed
636+
to be dynamic and not require cache invalidation.

configuration/env_var_processors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,5 +916,5 @@ this is already done for you, thanks to :ref:`autoconfiguration <services-autoco
916916
Resolving Environment Variable At Compile Time
917917
----------------------------------------------
918918

919-
Although environment variables are usually a runtime concept, you can also resolve them
919+
Environment variables are resolved at runtime, but you can also resolve them
920920
:ref:`at compile time <resolving-env-vars-at-compile-time>`.

0 commit comments

Comments
 (0)