Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Runtime] Support runtime options as a string#61522
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Looks good to me. You could add |
Very close to#45535. Did you consider populating --- a/public/index.php+++ b/public/index.php@@ -4,6 +4,10 @@ use App\Kernel; require_once dirname(__DIR__).'/vendor/autoload_runtime.php';+if (is_string($_SERVER['APP_RUNTIME_OPTIONS'] ??= $_ENV['APP_RUNTIME_OPTIONS'] ?? [])) {+ $_SERVER['APP_RUNTIME_OPTIONS'] = json_decode($_SERVER['APP_RUNTIME_OPTIONS'], true, JSON_THROW_ON_ERROR);+}+ return function (array $context) { return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']); }; |
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
/cc@ro0NL FYI
"Funny", I currently only used the bin/console so I added a similar check in my bin/console file but indeed, I will certainly have the same need in the index.php. I think adding this directly in Symfony runtime will
I'm only sad about the fact it's obviously considered as a new feature and I'll have to wait 7.4 ^^ |
(please add a line in the changelog of the component) |
Updated |
| 7.4 | ||
| --- | ||
| * Add support for using json_encoded`APP_RUNTIME_OPTIONS` value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| * Add support for usingjson_encoded`APP_RUNTIME_OPTIONS` value | |
| * Add support for usinga JSON encoded value for`APP_RUNTIME_OPTIONS` |
Thank you@VincentLanglet. |
c228caa intosymfony:7.4Uh oh!
There was an error while loading.Please reload this page.
…UNTIME']` (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 | MITLet's make this var consistently contain the runtime class.Options were already make so in#61522Commits-------1f1bf89 [Runtime] Expose the runtime class in `$_SERVER['APP_RUNTIME']`
Uh oh!
There was an error while loading.Please reload this page.
cc@nicolas-grekas since I think you worked a lot on this.
When setting the APP_RUNTIME_OPTIONS with docker or anything else than php, only a string can be used ; so it could be useful to support a string format for such options, I propose the classic json format and then use json_decode on string.
WDYT ?
I'm unsure how this template is tested...