瀏覽代碼

[FrameworkBundle] Added options auto-start and auto_start to the session configuration to allow session to be autostarted.

Henrik Bjørnskov 14 年之前
父節點
當前提交
91c5c910eb
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

+ 4 - 0
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

@@ -315,6 +315,10 @@ class FrameworkExtension extends Extension
             }
         }
 
+        if (isset($config['auto_start']) || isset($config['auto-start'])) {
+            $container->getDefinition('session')->addMethodCall('start');
+        }
+
         if (isset($config['class'])) {
             $container->setParameter('session.class', $config['class']);
         }