Skip to content

Commit 145abac

Browse files
committed
feature symfony#61592 [Runtime] Expose the runtime class in $_SERVER['APP_RUNTIME'] (nicolas-grekas)
This PR was merged into the 7.4 branch. Discussion ---------- [Runtime] Expose the runtime class in `$_SERVER['APP_RUNTIME']` | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | - | License | MIT Let's make this var consistently contain the runtime class. Options were already make so in symfony#61522 Commits ------- 1f1bf89 [Runtime] Expose the runtime class in `$_SERVER['APP_RUNTIME']`
2 parents 7278aa0 + 1f1bf89 commit 145abac

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Symfony/Component/Runtime/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ CHANGELOG
77
* Add JSON encoded value support for `APP_RUNTIME_OPTIONS`
88
* Add `FrankenPhpWorkerRunner`
99
* Add automatic detection of FrankenPHP worker mode in `SymfonyRuntime`
10+
* Expose the runtime class in `$_SERVER['APP_RUNTIME']`
11+
* Expose the runtime options in `$_SERVER['APP_RUNTIME_OPTIONS']`
1012

1113
6.4
1214
---

src/Symfony/Component/Runtime/Internal/autoload_runtime.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ if (!is_object($app)) {
1515
if (is_string($_SERVER['APP_RUNTIME_OPTIONS'] ??= $_ENV['APP_RUNTIME_OPTIONS'] ?? [])) {
1616
$_SERVER['APP_RUNTIME_OPTIONS'] = json_decode($_SERVER['APP_RUNTIME_OPTIONS'], true, 512, JSON_THROW_ON_ERROR);
1717
}
18-
$runtime = $_SERVER['APP_RUNTIME'] ?? $_ENV['APP_RUNTIME'] ?? %runtime_class%;
19-
$runtime = new $runtime($_SERVER['APP_RUNTIME_OPTIONS'] += %runtime_options%);
18+
$_SERVER['APP_RUNTIME'] ??= $_ENV['APP_RUNTIME'] ?? %runtime_class%;
19+
$runtime = new $_SERVER['APP_RUNTIME']($_SERVER['APP_RUNTIME_OPTIONS'] += %runtime_options%);
2020

2121
[$app, $args] = $runtime
2222
->getResolver($app)

0 commit comments

Comments
 (0)