8000 [HttpKernel] add "kernel.mode" for build-time env, keep "kernel.environment" for the runtime env by nicolas-grekas · Pull Request #38467 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel] add "kernel.mode" for build-time env, keep "kernel.environment" for the runtime env #38467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

nicolas-grekas
Copy link
Member
@nicolas-grekas nicolas-grekas commented Oct 7, 2020
Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? yes
Tickets Part of #34042
License MIT
Doc PR -

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 named APP_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 the framework.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.

@nicolas-grekas
Copy link
Member Author

Closing as explained in #34042 (comment)

@nicolas-grekas nicolas-grekas modified the milestones: 5.x, 5.2 Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0