-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Throw exception when the "session" extension is not loaded #32215
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
Merged
nicolas-grekas
merged 1 commit into
symfony:3.4
from
vudaltsov:31305-require-session-extension
Jun 28, 2019
Merged
[HttpFoundation] Throw exception when the "session" extension is not loaded #32215
nicolas-grekas
merged 1 commit into
symfony:3.4
from
vudaltsov:31305-require-session-extension
Jun 28, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
Outdated
Show resolved
Hide resolved
nicolas-grekas
approved these changes
Jun 28, 2019
01415cf
to
b0c6630
Compare
Thank you @vudaltsov. |
nicolas-grekas
added a commit
that referenced
this pull request
Jun 28, 2019
…nsion is not loaded (vudaltsov) This PR was squashed before being merged into the 3.4 branch (closes #32215). Discussion ---------- [HttpFoundation] Throw exception when the "session" extension is not loaded | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #31305 | License | MIT Should I target `3.4` or `master` instead? This change does not alter behavior, but makes the failure more clear. Commits ------- b0c6630 [HttpFoundation] Throw exception when the \"session\" extension is not loaded
Tobion
reviewed
Jun 28, 2019
@@ -233,6 +233,10 @@ public function load(array $configs, ContainerBuilder $container) | |||
} | |||
|
|||
if ($this->isConfigEnabled($container, $config['session'])) { | |||
if (!\extension_loaded('session')) { | |||
throw new \LogicException('PHP extension "session" is required.'); |
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.
I think this should say "... because the session config is enabled" to make it clear that the alternative might be to disable sessions (which got enabled automatically because of flex).
fabpot
added a commit
that referenced
this pull request
Jun 29, 2019
…Tobion) This PR was merged into the 3.4 branch. Discussion ---------- [FrameworkBundle] better message for disabled sessions | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #32215 | License | MIT | Doc PR | Use correct exception class and make the message consistent with all the other exception messages in the FrameworkExtension. Commits ------- b3e3247 [FrameworkBundle] better message for disabled sessions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 applied 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.
Should I target
3.4
ormaster
instead? This change does not alter behavior, but makes the failure more clear.