merged branch drak/nullhandler (PR #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 #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

👍
This commit is contained in:
Fabien Potencier 2012-08-18 10:24:48 +02:00
commit df889fb28b
1 changed files with 6 additions and 1 deletions

View File

@ -294,7 +294,12 @@ class FrameworkExtension extends Extension
$container->setParameter('session.storage.options', $options);
// session handler (the internal callback registered with PHP session management)
$container->setAlias('session.handler', $config['handler_id']);
if (null == $config['handler_id']) {
// Set the handler class to be null
$container->getDefinition('session.storage.native')->replaceArgument(1, null);
} else {
$container->setAlias('session.handler', $config['handler_id']);
}
$container->setParameter('session.save_path', $config['save_path']);