[HttpFoundation] Throw exception when the \"session\" extension is not loaded
This commit is contained in:
parent
00552848f8
commit
b0c663071b
|
@ -233,6 +233,10 @@ class FrameworkExtension extends Extension
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->isConfigEnabled($container, $config['session'])) {
|
if ($this->isConfigEnabled($container, $config['session'])) {
|
||||||
|
if (!\extension_loaded('session')) {
|
||||||
|
throw new \LogicException('PHP extension "session" is required.');
|
||||||
|
}
|
||||||
|
|
||||||
$this->sessionConfigEnabled = true;
|
$this->sessionConfigEnabled = true;
|
||||||
$this->registerSessionConfiguration($config['session'], $container, $loader);
|
$this->registerSessionConfiguration($config['session'], $container, $loader);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,6 +100,10 @@ class NativeSessionStorage implements SessionStorageInterface
|
||||||
*/
|
*/
|
||||||
public function __construct(array $options = [], $handler = null, MetadataBag $metaBag = null)
|
public function __construct(array $options = [], $handler = null, MetadataBag $metaBag = null)
|
||||||
{
|
{
|
||||||
|
if (!\extension_loaded('session')) {
|
||||||
|
throw new \LogicException('PHP extension "session" is required.');
|
||||||
|
}
|
||||||
|
|
||||||
$options += [
|
$options += [
|
||||||
'cache_limiter' => '',
|
'cache_limiter' => '',
|
||||||
'cache_expire' => 0,
|
'cache_expire' => 0,
|
||||||
|
|
|
@ -24,6 +24,10 @@ class PhpBridgeSessionStorage extends NativeSessionStorage
|
||||||
*/
|
*/
|
||||||
public function __construct($handler = null, MetadataBag $metaBag = null)
|
public function __construct($handler = null, MetadataBag $metaBag = null)
|
||||||
{
|
{
|
||||||
|
if (!\extension_loaded('session')) {
|
||||||
|
throw new \LogicException('PHP extension "session" is required.');
|
||||||
|
}
|
||||||
|
|
||||||
$this->setMetadataBag($metaBag);
|
$this->setMetadataBag($metaBag);
|
||||||
$this->setSaveHandler($handler);
|
$this->setSaveHandler($handler);
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue