Skip to content

Commit 9effd6b

Browse files
minor #32215 [HttpFoundation] Throw exception when the "session" extension 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 ------- b0c663071b [HttpFoundation] Throw exception when the \"session\" extension is not loaded
2 parents 79497dc + 8785760 commit 9effd6b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,10 @@ public function load(array $configs, ContainerBuilder $container)
233233
}
234234

235235
if ($this->isConfigEnabled($container, $config['session'])) {
236+
if (!\extension_loaded('session')) {
237+
throw new \LogicException('PHP extension "session" is required.');
238+
}
239+
236240
$this->sessionConfigEnabled = true;
237241
$this->registerSessionConfiguration($config['session'], $container, $loader);
238242
}

0 commit comments

Comments
 (0)