Skip to content

Commit df889fb

Browse files
committed
merged branch drak/nullhandler (PR symfony#5290)
Commits ------- 8e11aaa [FrameworkBundle] Allow to set null for the handler in NativeSessionStorage Discussion ---------- [FrameworkBundle] Allow to set null for the handler in NativeSessionStorage Bug fix: no Feature addition: yes (ok for RC) Backwards compatibility break: yes Symfony2 tests pass: yes Fixes the following tickets: 5267 Todo: ~ License of the code: MIT Documentation PR: ~ Refs symfony#5267 Adds the following configuration ``` session: handler_id: ~ ``` Which allows the configuration of the session not to use any save handler and therefor just use whatever save_handler is set in `php.ini` --------------------------------------------------------------------------- by dlsniper at 2012-08-17T17:24:37Z :+1:
2 parents 248a48a + 8e11aaa commit df889fb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,12 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
294294
$container->setParameter('session.storage.options', $options);
295295

296296
// session handler (the internal callback registered with PHP session management)
297-
$container->setAlias('session.handler', $config['handler_id']);
297+
if (null == $config['handler_id']) {
298+
// Set the handler class to be null
299+
$container->getDefinition('session.storage.native')->replaceArgument(1, null);
300+
} else {
301+
$container->setAlias('session.handler', $config['handler_id']);
302+
}
298303

299304
$container->setParameter('session.save_path', $config['save_path']);
300305

0 commit comments

Comments
 (0)