Skip to content

Commit 7da0a05

Browse files
committed
feature #38543 [HttpKernel] add kernel.runtime_environment = %env(default:kernel.environment:APP_RUNTIME_ENV)% parameter (nicolas-grekas)
This PR was merged into the 5.x branch. Discussion ---------- [HttpKernel] add `kernel.runtime_environment` = `%env(default:kernel.environment:APP_RUNTIME_ENV)%` parameter | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Instead of #37584 This PR adds a new `kernel.runtime_environment` parameter, which creates a convention to use the `APP_RUNTIME_ENV` env var to define the name of the runtime environment where the app is deployed. When this env var is not set, the parameter defaults to `kernel.environment`. This is especially useful for defining the location of the vault for secrets: an app can be deployed in "prod" mode, but still not be deployed on the real prod deployment target. When this happens, one might not use real prod secrets but instead, use a vault with creds for staging. This parameter enables this use case. Commits ------- 6eb9d62bdd [HttpKernel] add `kernel.runtime_environment` = `%env(default:kernel.environment:APP_RUNTIME_ENV)%` parameter
2 parents ce5e8b5 + a5ff1d5 commit 7da0a05

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ CHANGELOG
1212
in the request profiler raw content section
1313
* Allowed adding attributes on controller arguments that will be passed to argument resolvers.
1414
* kernels implementing the `ExtensionInterface` will now be auto-registered to the container
15+
* added parameter `kernel.runtime_environment`, defined as `%env(default:kernel.environment:APP_RUNTIME_ENV)%`
1516

1617
5.1.0
1718
-----

Kernel.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ protected function getKernelParameters()
606606
return [
607607
'kernel.project_dir' => realpath($this->getProjectDir()) ?: $this->getProjectDir(),
608608
'kernel.environment' => $this->environment,
609+
'kernel.runtime_environment' => '%env(default:kernel.environment:APP_RUNTIME_ENV)%',
609610
'kernel.debug' => $this->debug,
610611
'kernel.build_dir' => realpath($buildDir = $this->warmupDir ?: $this->getBuildDir()) ?: $buildDir,
611612
'kernel.cache_dir' => realpath($this->getCacheDir()) ?: $this->getCacheDir(),

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"symfony/config": "^5.0",
3333
"symfony/console": "^4.4|^5.0",
3434
"symfony/css-selector": "^4.4|^5.0",
35-
"symfony/dependency-injection": "^4.4|^5.0",
35+
"symfony/dependency-injection": "^5.1.8",
3636
"symfony/dom-crawler": "^4.4|^5.0",
3737
"symfony/expression-language": "^4.4|^5.0",
3838
"symfony/finder": "^4.4|^5.0",
@@ -53,7 +53,7 @@
5353
"symfony/config": "<5.0",
5454
"symfony/console": "<4.4",
5555
"symfony/form": "<5.0",
56-
"symfony/dependency-injection": "<4.4",
56+
"symfony/dependency-injection": "<5.1.8",
5757
"symfony/doctrine-bridge": "<5.0",
5858
"symfony/http-client": "<5.0",
5959
"symfony/mailer": "<5.0",

0 commit comments

Comments
 (0)