Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[FrameworkBundle] Remove 'auto_start' configuration parameter.

  • Loading branch information...
commit 1fd66f3cdf55ea63b3c1ee968cd2d0d774c9ea4e 1 parent 8ebe624
Drak authored
View
2  src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
@@ -32,3 +32,5 @@ CHANGELOG
`gc_probability`/`gc_divisor` chance of being run. The `gc_maxlifetime` defines
how long a session can idle for. It is different from cookie lifetime which
declares how long a cookie can be stored on the remote client.
+ * Removed 'auto_start' configuration parameter from session config. The session will
+ start on demand.
View
2  src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
@@ -176,7 +176,7 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
->info('session configuration')
->canBeUnset()
->children()
- ->booleanNode('auto_start')->defaultFalse()->end()
+ ->booleanNode('auto_start')->info('DEPRECATED! Session wil start on demand')->end()
->scalarNode('storage_id')->defaultValue('session.storage.native')->end()
->scalarNode('handler_id')->defaultValue('session.handler.native_file')->end()
->scalarNode('name')->end()
View
5 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
@@ -291,13 +291,10 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
{
$loader->load('session.xml');
- // session
- $container->getDefinition('session_listener')->addArgument($config['auto_start']);
-
// session storage
$container->setAlias('session.storage', $config['storage_id']);
$options = array();
- foreach (array('name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'auto_start', 'gc_maxlifetime', 'gc_probability', 'gc_divisor') as $key) {
+ foreach (array('name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'gc_maxlifetime', 'gc_probability', 'gc_divisor') as $key) {
if (isset($config[$key])) {
$options[$key] = $config[$key];
}
View
1  src/Symfony/Bundle/FrameworkBundle/EventListener/SessionListener.php
@@ -41,7 +41,6 @@ class SessionListener implements EventSubscriberInterface
public function __construct(ContainerInterface $container, $autoStart = false)
{
$this->container = $container;
- $this->autoStart = $autoStart;
}
public function onKernelRequest(GetResponseEvent $event)
View
1  src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_full.php
@@ -3,7 +3,6 @@
$container->loadFromExtension('framework', array(
'secret' => 's3cr3t',
'session' => array(
- 'auto_start' => true,
'storage_id' => 'session.storage.native',
'handler_id' => 'session.handler.native_file',
'name' => '_SYMFONY',
View
1  src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_partial.php
@@ -3,7 +3,6 @@
$container->loadFromExtension('framework', array(
'secret' => 's3cr3t',
'session' => array(
- 'auto_start' => true,
'storage_id' => 'session.storage.native',
'handler_id' => 'session.handler.native_file',
'name' => '_SYMFONY',
View
1  src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php
@@ -19,7 +19,6 @@
'type' => 'xml',
),
'session' => array(
- 'auto_start' => true,
'storage_id' => 'session.storage.native',
'handler_id' => 'session.handler.native_file',
'name' => '_SYMFONY',
View
1  src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_full.yml
@@ -1,7 +1,6 @@
framework:
secret: s3cr3t
session:
- auto_start: true
storage_id: session.storage.native
handler_id: session.handler.native_file
name: _SYMFONY
View
1  src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_partial.yml
@@ -1,7 +1,6 @@
framework:
secret: s3cr3t
session:
- auto_start: true
storage_id: session.storage.native
handler_id: session.handler.native_file
name: _SYMFONY
View
1  src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml
@@ -13,7 +13,6 @@ framework:
resource: %kernel.root_dir%/config/routing.xml
type: xml
session:
- auto_start: true
storage_id: session.storage.native
handler_id: session.handler.native_file
name: _SYMFONY
View
1  src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
@@ -77,7 +77,6 @@ public function testSession()
$this->assertTrue($container->hasDefinition('session'), '->registerSessionConfiguration() loads session.xml');
$this->assertEquals('fr', $container->getParameter('kernel.default_locale'));
- $this->assertTrue($container->getDefinition('session_listener')->getArgument(1));
$this->assertEquals('session.storage.native', (string) $container->getAlias('session.storage'));
$this->assertEquals('session.handler.native_file', (string) $container->getAlias('session.handler'));
View
1  src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/SessionHelperTest.php
@@ -25,6 +25,7 @@ protected function setUp()
$this->request = new Request();
$session = new Session(new MockArraySessionStorage());
+ $session->start();
$session->set('foobar', 'bar');
$session->getFlashBag()->set('notice', 'bar');

4 comments on commit 1fd66f3

@manuelmazzuola

That commit break the flash_message_listener service

$php app/console cache:clear
                                                                                                       
  [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]                           
  The service "fos_rest.flash_message_listener" has a dependency on a non-existent service "session".  
                                                                                                       

@fabpot
Owner

@manuelmazzuola You must report this issue on the fos_rest repository as it must be fixed there.

@stof
Collaborator

@manuelmazzuola if you remove the session key itself from your app, it means that you are disabling the session entirely in your app.

@stof
Collaborator

@drak You still have to define session: ~ in your config. Otherwise, you simply don't have the service definition for the session (just like removing csrf_protection: true removes the CSRF provider, and removing the router section removes the router)

Please sign in to comment.
Something went wrong with that request. Please try again.