Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b0c6630

Browse filesBrowse files
vudaltsovnicolas-grekas
authored andcommitted
[HttpFoundation] Throw exception when the \"session\" extension is not loaded
1 parent 0055284 commit b0c6630
Copy full SHA for b0c6630

File tree

Expand file treeCollapse file tree

3 files changed

+12
-0
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+12
-0
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+4Lines 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
}

‎src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ class NativeSessionStorage implements SessionStorageInterface
100100
*/
101101
public function __construct(array $options = [], $handler = null, MetadataBag $metaBag = null)
102102
{
103+
if (!\extension_loaded('session')) {
104+
throw new \LogicException('PHP extension "session" is required.');
105+
}
106+
103107
$options += [
104108
'cache_limiter' => '',
105109
'cache_expire' => 0,

‎src/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/PhpBridgeSessionStorage.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class PhpBridgeSessionStorage extends NativeSessionStorage
2424
*/
2525
public function __construct($handler = null, MetadataBag $metaBag = null)
2626
{
27+
if (!\extension_loaded('session')) {
28+
throw new \LogicException('PHP extension "session" is required.');
29+
}
30+
2731
$this->setMetadataBag($metaBag);
2832
$this->setSaveHandler($handler);
2933
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.