Skip to content
This repository
Browse code

[FrameworkBundle] removed deprecated cookie options

  • Loading branch information...
commit 0bb5d01f320b8f6af93f61b3351ba18addbc75d0 1 parent b3081e8
Fabien Potencier fabpot authored
5 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
@@ -222,11 +222,6 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
222 222 ->scalarNode('gc_probability')->end()
223 223 ->scalarNode('gc_maxlifetime')->end()
224 224 ->scalarNode('save_path')->defaultValue('%kernel.cache_dir%/sessions')->end()
225   - ->scalarNode('lifetime')->info('DEPRECATED! Please use: cookie_lifetime')->end()
226   - ->scalarNode('path')->info('DEPRECATED! Please use: cookie_path')->end()
227   - ->scalarNode('domain')->info('DEPRECATED! Please use: cookie_domain')->end()
228   - ->booleanNode('secure')->info('DEPRECATED! Please use: cookie_secure')->end()
229   - ->booleanNode('httponly')->info('DEPRECATED! Please use: cookie_httponly')->end()
230 225 ->end()
231 226 ->end()
232 227 ->end()
7 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
@@ -308,13 +308,6 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
308 308 }
309 309 }
310 310
311   - //we deprecated session options without cookie_ prefix, but we are still supporting them,
312   - //Let's merge the ones that were supplied without prefix
313   - foreach (array('lifetime', 'path', 'domain', 'secure', 'httponly') as $key) {
314   - if (!isset($options['cookie_'.$key]) && isset($config[$key])) {
315   - $options['cookie_'.$key] = $config[$key];
316   - }
317   - }
318 311 $container->setParameter('session.storage.options', $options);
319 312
320 313 // session handler (the internal callback registered with PHP session management)
5 src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd
@@ -88,11 +88,6 @@
88 88 <xsd:attribute name="cookie-secure" type="xsd:boolean" />
89 89 <xsd:attribute name="cookie-httponly" type="xsd:boolean" />
90 90 <!-- deprecated attributes -->
91   - <xsd:attribute name="lifetime" type="xsd:string" />
92   - <xsd:attribute name="path" type="xsd:string" />
93   - <xsd:attribute name="domain" type="xsd:string" />
94   - <xsd:attribute name="secure" type="xsd:boolean" />
95   - <xsd:attribute name="httponly" type="xsd:boolean" />
96 91 <xsd:attribute name="auto-start" type="xsd:boolean" />
97 92 <!-- end of deprecated attributes -->
98 93 <xsd:attribute name="cache-limiter" type="xsd:string" />
20 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_full.php
... ... @@ -1,20 +0,0 @@
1   -<?php
2   -
3   -$container->loadFromExtension('framework', array(
4   - 'secret' => 's3cr3t',
5   - 'session' => array(
6   - 'storage_id' => 'session.storage.native',
7   - 'handler_id' => 'session.handler.native_file',
8   - 'name' => '_SYMFONY',
9   - 'lifetime' => 2012,
10   - 'path' => '/sf2',
11   - 'domain' => 'sf2.example.com',
12   - 'secure' => false,
13   - 'httponly' => false,
14   - 'cookie_lifetime' => 86400,
15   - 'cookie_path' => '/',
16   - 'cookie_domain' => 'example.com',
17   - 'cookie_secure' => true,
18   - 'cookie_httponly' => true,
19   - ),
20   -));
17 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_partial.php
... ... @@ -1,17 +0,0 @@
1   -<?php
2   -
3   -$container->loadFromExtension('framework', array(
4   - 'secret' => 's3cr3t',
5   - 'session' => array(
6   - 'storage_id' => 'session.storage.native',
7   - 'handler_id' => 'session.handler.native_file',
8   - 'name' => '_SYMFONY',
9   - 'lifetime' => 2012,
10   - 'path' => '/sf2',
11   - 'domain' => 'sf2.example.com',
12   - 'secure' => false,
13   - 'cookie_lifetime' => 86400,
14   - 'cookie_path' => '/',
15   - 'cookie_httponly' => true,
16   - ),
17   -));
24 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php
@@ -22,18 +22,18 @@
22 22 'type' => 'xml',
23 23 ),
24 24 'session' => array(
25   - 'storage_id' => 'session.storage.native',
26   - 'handler_id' => 'session.handler.native_file',
27   - 'name' => '_SYMFONY',
28   - 'lifetime' => 86400,
29   - 'path' => '/',
30   - 'domain' => 'example.com',
31   - 'secure' => true,
32   - 'httponly' => true,
33   - 'gc_maxlifetime' => 90000,
34   - 'gc_divisor' => 108,
35   - 'gc_probability' => 1,
36   - 'save_path' => '/path/to/sessions',
  25 + 'storage_id' => 'session.storage.native',
  26 + 'handler_id' => 'session.handler.native_file',
  27 + 'name' => '_SYMFONY',
  28 + 'cookie_lifetime' => 86400,
  29 + 'cookie_path' => '/',
  30 + 'cookie_domain' => 'example.com',
  31 + 'cookie_secure' => true,
  32 + 'cookie_httponly' => true,
  33 + 'gc_maxlifetime' => 90000,
  34 + 'gc_divisor' => 108,
  35 + 'gc_probability' => 1,
  36 + 'save_path' => '/path/to/sessions',
37 37 ),
38 38 'templating' => array(
39 39 'assets_version' => 'SomeVersionScheme',
12 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_full.xml
... ... @@ -1,12 +0,0 @@
1   -<?xml version="1.0" ?>
2   -
3   -<container xmlns="http://symfony.com/schema/dic/services"
4   - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5   - xmlns:framework="http://symfony.com/schema/dic/symfony"
6   - xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
7   - http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
8   -
9   - <framework:config secret="s3cr3t">
10   - <framework:session storage-id="session.storage.native" handler-id="session.handler.native_file" name="_SYMFONY" lifetime="2012" path="/sf2" domain="sf2.example.com" secure="false" httponly="false" cookie-lifetime="86400" cookie-path="/" cookie-domain="example.com" cookie-secure="true" cookie-httponly="true" />
11   - </framework:config>
12   -</container>
12 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_partial.xml
... ... @@ -1,12 +0,0 @@
1   -<?xml version="1.0" ?>
2   -
3   -<container xmlns="http://symfony.com/schema/dic/services"
4   - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5   - xmlns:framework="http://symfony.com/schema/dic/symfony"
6   - xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
7   - http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
8   -
9   - <framework:config secret="s3cr3t">
10   - <framework:session storage-id="session.storage.native" handler-id="session.handler.native_file" name="_SYMFONY" lifetime="2012" path="/sf2" domain="sf2.example.com" secure="false" httponly="false" cookie-lifetime="86400" cookie-path="/" cookie-httponly="true" />
11   - </framework:config>
12   -</container>
16 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_full.yml
... ... @@ -1,16 +0,0 @@
1   -framework:
2   - secret: s3cr3t
3   - session:
4   - storage_id: session.storage.native
5   - handler_id: session.handler.native_file
6   - name: _SYMFONY
7   - lifetime: 2012
8   - path: /sf2
9   - domain: sf2.example.com
10   - secure: false
11   - httponly: false
12   - cookie_lifetime: 86400
13   - cookie_path: /
14   - cookie_domain: example.com
15   - cookie_secure: true
16   - cookie_httponly: true
14 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/deprecated_merge_partial.yml
... ... @@ -1,14 +0,0 @@
1   -framework:
2   - secret: s3cr3t
3   - session:
4   - storage_id: session.storage.native
5   - handler_id: session.handler.native_file
6   - name: _SYMFONY
7   - lifetime: 2012
8   - path: /sf2
9   - domain: sf2.example.com
10   - secure: false
11   - httponly: false
12   - cookie_lifetime: 86400
13   - cookie_path: /
14   - cookie_httponly: true
24 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml
@@ -16,18 +16,18 @@ framework:
16 16 resource: %kernel.root_dir%/config/routing.xml
17 17 type: xml
18 18 session:
19   - storage_id: session.storage.native
20   - handler_id: session.handler.native_file
21   - name: _SYMFONY
22   - lifetime: 86400
23   - path: /
24   - domain: example.com
25   - secure: true
26   - httponly: true
27   - gc_probability: 1
28   - gc_divisor: 108
29   - gc_maxlifetime: 90000
30   - save_path: /path/to/sessions
  19 + storage_id: session.storage.native
  20 + handler_id: session.handler.native_file
  21 + name: _SYMFONY
  22 + cookie_lifetime: 86400
  23 + cookie_path: /
  24 + cookie_domain: example.com
  25 + cookie_secure: true
  26 + cookie_httponly: true
  27 + gc_probability: 1
  28 + gc_divisor: 108
  29 + gc_maxlifetime: 90000
  30 + save_path: /path/to/sessions
31 31 templating:
32 32 assets_version: SomeVersionScheme
33 33 assets_base_urls: http://cdn.example.com
30 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
@@ -111,36 +111,6 @@ public function testSession()
111 111 $this->assertEquals('/path/to/sessions', $container->getParameter('session.save_path'));
112 112 }
113 113
114   - public function testSessionDeprecatedMergeFull()
115   - {
116   - $container = $this->createContainerFromFile('deprecated_merge_full');
117   -
118   - $this->assertTrue($container->hasDefinition('session'), '->registerSessionConfiguration() loads session.xml');
119   -
120   - $options = $container->getParameter('session.storage.options');
121   - $this->assertEquals('_SYMFONY', $options['name']);
122   - $this->assertEquals(86400, $options['cookie_lifetime']);
123   - $this->assertEquals('/', $options['cookie_path']);
124   - $this->assertEquals('example.com', $options['cookie_domain']);
125   - $this->assertTrue($options['cookie_secure']);
126   - $this->assertTrue($options['cookie_httponly']);
127   - }
128   -
129   - public function testSessionDeprecatedMergePartial()
130   - {
131   - $container = $this->createContainerFromFile('deprecated_merge_partial');
132   -
133   - $this->assertTrue($container->hasDefinition('session'), '->registerSessionConfiguration() loads session.xml');
134   -
135   - $options = $container->getParameter('session.storage.options');
136   - $this->assertEquals('_SYMFONY', $options['name']);
137   - $this->assertEquals(86400, $options['cookie_lifetime']);
138   - $this->assertEquals('/', $options['cookie_path']);
139   - $this->assertEquals('sf2.example.com', $options['cookie_domain']);
140   - $this->assertFalse($options['cookie_secure']);
141   - $this->assertTrue($options['cookie_httponly']);
142   - }
143   -
144 114 public function testTemplating()
145 115 {
146 116 $container = $this->createContainerFromFile('full');

0 comments on commit 0bb5d01

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