Skip to content

[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

Conversation

vudaltsov
Copy link
Contributor

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.

@nicolas-grekas nicolas-grekas force-pushed the 31305-require-session-extension branch from 01415cf to b0c6630 Compare June 28, 2019 12:47
@nicolas-grekas
Copy link
Member

Thank you @vudaltsov.

@nicolas-grekas nicolas-grekas merged commit b0c6630 into symfony:3.4 Jun 28, 2019
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
@vudaltsov vudaltsov deleted the 31305-require-session-extension branch June 28, 2019 12:49
@@ -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.');
Copy link
Contributor

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants