[HttpKernel] add "kernel.mode" for build-time env, keep "kernel.environment" for the runtime env #38467
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be a
2F53
pplied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow up of #37584
This PR renames the "kernel environment" to use the "kernel mode" terminology.
The "mode" (prod/dev/test) is the name of the build-time environment.
A new parameter is introduced, named
%kernel.mode%
, which holds the same as what is currently named%kernel.environment%
.%kernel.environment%
is kept but now becomes a reference to an env var namedAPP_RUNTIME_ENV
by default (and which defaults to%kernel.mode%
when the env var is not set.)This creates a potential BC breaks for apps that read the value of
%kernel.environment%
at compile time. I don't know if that's a blocker or not. In Symfony itself, we always use$kernel->getEnvironment()
so that this is never an issue. The only place where we use%kernel.environment%
is in theframework.secrets
config tree and this one should stay as-is: we do want this to be runtime-configurable.Pending recipe update coming next.
#36652 to be updated accordingly also.