Skip to content

Commit 2675007

Browse files
committed
merged branch fabpot/deprecated (PR #7227)
This PR was merged into the master branch. Discussion ---------- [WIP] Removed deprecated stuff Commits ------- f2a8908 removed deprecated functionality from RouteCollection 4f4a5d1 [TwigBundle] removed deprecated syntax 45bd413 [FrameworkBundle] removed deprecated options 0bb5d01 [FrameworkBundle] removed deprecated cookie options b3081e8 [Form] removed deprecated methods and classes e0385a2 [Validator] removed deprecated methods 65e3b16 [Validator] removed deprecated constraints 4a70ddf [HttpFoundation] removed deprecated session methods 4e7943f [Yaml] removed deprecated support of PHP parsin when parsing YAML files 09a5969 [HttpFoundation] removed deprecated Request::splitHttpAcceptHeader() method c28f1b0 removed deprected way to declared trusted proxies 5ff6006 removed deprecated stuff in the fragment sub-framework 0a06a7c [Translation] removed deprecated classes 67f6397 [Security] removed deprecated classes
2 parents 5b5c7db + f2a8908 commit 2675007

File tree

119 files changed

+91
-5865
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+91
-5865
lines changed

src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,6 @@ public function guessMaxLength($class, $property)
138138
}
139139
}
140140

141-
/**
142-
* {@inheritDoc}
143-
*/
144-
public function guessMinLength($class, $property)
145-
{
146-
trigger_error('guessMinLength() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED);
147-
}
148-
149141
/**
150142
* {@inheritDoc}
151143
*/

src/Symfony/Bridge/Propel1/Form/PropelTypeGuesser.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,6 @@ public function guessMaxLength($class, $property)
129129
}
130130
}
131131

132-
/**
133-
* {@inheritDoc}
134-
*/
135-
public function guessMinLength($class, $property)
136-
{
137-
trigger_error('guessMinLength() is deprecated since version 2.1 and will be removed in 2.3.', E_USER_DEPRECATED);
138-
}
139-
140132
/**
141133
* {@inheritDoc}
142134
*/

src/Symfony/Bridge/Twig/Extension/HttpKernelExtension.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ public function getFunctions()
5454
*/
5555
public function renderFragment($uri, $options = array())
5656
{
57-
$options = $this->handler->fixOptions($options);
58-
5957
$strategy = isset($options['strategy']) ? $options['strategy'] : 'inline';
6058
unset($options['strategy']);
6159

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

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ class Configuration implements ConfigurationInterface
2626
* Generates the configuration tree builder.
2727
*
2828
* @return TreeBuilder The tree builder
29-
*
30-
* @throws \RuntimeException When using the deprecated 'charset' setting
3129
*/
3230
public function getConfigTreeBuilder()
3331
{
@@ -36,27 +34,11 @@ public function getConfigTreeBuilder()
3634

3735
$rootNode
3836
->children()
39-
->scalarNode('charset')
40-
->defaultNull()
41-
->beforeNormalization()
42-
->ifTrue(function($v) { return null !== $v; })
43-
->then(function($v) {
44-
$message = 'The charset setting is deprecated. Just remove it from your configuration file.';
45-
46-
if ('UTF-8' !== $v) {
47-
$message .= sprintf('You need to define a getCharset() method in your Application Kernel class that returns "%s".', $v);
48-
}
49-
50-
throw new \RuntimeException($message);
51-
})
52-
->end()
53-
->end()
5437
->scalarNode('secret')->end()
5538
->scalarNode('http_method_override')
5639
->info("Set true to enable support for the '_method' request parameter to determine the intended HTTP method on POST requests.")
5740
->defaultTrue()
5841
->end()
59-
->scalarNode('trust_proxy_headers')->defaultFalse()->end() // @deprecated, to be removed in 2.3
6042
->arrayNode('trusted_proxies')
6143
->beforeNormalization()
6244
->ifTrue(function($v) { return !is_array($v) && !is_null($v); })
@@ -201,16 +183,6 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
201183
->info('session configuration')
202184
->canBeUnset()
203185
->children()
204-
->booleanNode('auto_start')
205-
->info('DEPRECATED! Session starts on demand')
206-
->defaultFalse()
207-
->beforeNormalization()
208-
->ifTrue(function($v) { return null !== $v; })
209-
->then(function($v) {
210-
throw new \RuntimeException('The auto_start setting is deprecated. Just remove it from your configuration file.');
211-
})
212-
->end()
213-
->end()
214186
->scalarNode('storage_id')->defaultValue('session.storage.native')->end()
215187
->scalarNode('handler_id')->defaultValue('session.handler.native_file')->end()
216188
->scalarNode('name')->end()
@@ -223,11 +195,6 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
223195
->scalarNode('gc_probability')->end()
224196
->scalarNode('gc_maxlifetime')->end()
225197
->scalarNode('save_path')->defaultValue('%kernel.cache_dir%/sessions')->end()
226-
->scalarNode('lifetime')->info('DEPRECATED! Please use: cookie_lifetime')->end()
227-
->scalarNode('path')->info('DEPRECATED! Please use: cookie_path')->end()
228-
->scalarNode('domain')->info('DEPRECATED! Please use: cookie_domain')->end()
229-
->booleanNode('secure')->info('DEPRECATED! Please use: cookie_secure')->end()
230-
->booleanNode('httponly')->info('DEPRECATED! Please use: cookie_httponly')->end()
231198
->end()
232199
->end()
233200
->end()

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ public function load(array $configs, ContainerBuilder $container)
6969
$container->setParameter('kernel.http_method_override', $config['http_method_override']);
7070

7171
$container->setParameter('kernel.trusted_proxies', $config['trusted_proxies']);
72-
73-
// @deprecated, to be removed in 2.3
74-
$container->setParameter('kernel.trust_proxy_headers', $config['trust_proxy_headers']);
75-
7672
$container->setParameter('kernel.default_locale', $config['default_locale']);
7773

7874
if (!empty($config['test'])) {
@@ -312,13 +308,6 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
312308
}
313309
}
314310

315-
//we deprecated session options without cookie_ prefix, but we are still supporting them,
316-
//Let's merge the ones that were supplied without prefix
317-
foreach (array('lifetime', 'path', 'domain', 'secure', 'httponly') as $key) {
318-
if (!isset($options['cookie_'.$key]) && isset($config[$key])) {
319-
$options['cookie_'.$key] = $config[$key];
320-
}
321-
}
322311
$container->setParameter('session.storage.options', $options);
323312

324313
// session handler (the internal callback registered with PHP session management)

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ public function boot()
4343
{
4444
if ($trustedProxies = $this->container->getParameter('kernel.trusted_proxies')) {
4545
Request::setTrustedProxies($trustedProxies);
46-
} elseif ($this->container->getParameter('kernel.trust_proxy_headers')) {
47-
Request::trustProxyData(); // @deprecated, to be removed in 2.3
4846
}
4947

5048
if ($this->container->getParameter('kernel.http_method_override')) {

src/Symfony/Bundle/FrameworkBundle/HttpKernel.php

Lines changed: 0 additions & 83 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222
<xsd:element name="annotations" type="annotations" minOccurs="0" maxOccurs="1" />
2323
</xsd:all>
2424

25-
<!-- charset is deprecated and will be removed in 2.2 -->
26-
<xsd:attribute name="charset" type="xsd:string" />
2725
<xsd:attribute name="http-method-override" type="xsd:boolean" />
28-
<xsd:attribute name="trust-proxy-headers" type="xsd:string" />
2926
<xsd:attribute name="trusted-proxies" type="xsd:string" />
3027
<xsd:attribute name="ide" type="xsd:string" />
3128
<xsd:attribute name="secret" type="xsd:string" />
@@ -88,14 +85,6 @@
8885
<xsd:attribute name="cookie-domain" type="xsd:string" />
8986
<xsd:attribute name="cookie-secure" type="xsd:boolean" />
9087
<xsd:attribute name="cookie-httponly" type="xsd:boolean" />
91-
<!-- deprecated attributes -->
92-
<xsd:attribute name="lifetime" type="xsd:string" />
93-
<xsd:attribute name="path" type="xsd:string" />
94-
<xsd:attribute name="domain" type="xsd:string" />
95-
<xsd:attribute name="secure" type="xsd:boolean" />
96-
<xsd:attribute name="httponly" type="xsd:boolean" />
97-
<xsd:attribute name="auto-start" type="xsd:boolean" />
98-
<!-- end of deprecated attributes -->
9988
<xsd:attribute name="cache-limiter" type="xsd:string" />
10089
<xsd:attribute name="gc-maxlifetime" type="xsd:string" />
10190
<xsd:attribute name="gc-divisor" type="xsd:string" />

src/Symfony/Bundle/FrameworkBundle/Resources/config/services.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<parameters>
88
<parameter key="event_dispatcher.class">Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher</parameter>
9-
<parameter key="http_kernel.class">Symfony\Bundle\FrameworkBundle\HttpKernel</parameter>
9+
<parameter key="http_kernel.class">Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel</parameter>
1010
<parameter key="filesystem.class">Symfony\Component\Filesystem\Filesystem</parameter>
1111
<parameter key="cache_warmer.class">Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate</parameter>
1212
<parameter key="cache_clearer.class">Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer</parameter>

src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ public function __construct(FragmentHandler $handler)
4646
*/
4747
public function render($uri, array $options = array())
4848
{
49-
$options = $this->handler->fixOptions($options);
50-
5149
$strategy = isset($options['strategy']) ? $options['strategy'] : 'inline';
5250
unset($options['strategy']);
5351

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ public function testInvalidValueTrustedProxies()
8787
protected static function getBundleDefaultConfig()
8888
{
8989
return array(
90-
'charset' => null,
9190
'http_method_override' => true,
92-
'trust_proxy_headers' => false,
9391
'trusted_proxies' => array(),
9492
'ide' => null,
9593
'default_locale' => 'en',

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_full.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/deprecated_merge_partial.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
'default_locale' => 'fr',
66
'form' => null,
77
'http_method_override' => false,
8-
'trust_proxy_headers' => true,
98
'trusted_proxies' => array('127.0.0.1', '10.0.0.1'),
109
'csrf_protection' => array(
1110
'enabled' => true,
@@ -23,18 +22,18 @@
2322
'type' => 'xml',
2423
),
2524
'session' => array(
26-
'storage_id' => 'session.storage.native',
27-
'handler_id' => 'session.handler.native_file',
28-
'name' => '_SYMFONY',
29-
'lifetime' => 86400,
30-
'path' => '/',
31-
'domain' => 'example.com',
32-
'secure' => true,
33-
'httponly' => true,
34-
'gc_maxlifetime' => 90000,
35-
'gc_divisor' => 108,
36-
'gc_probability' => 1,
37-
'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',
3837
),
3938
'templating' => array(
4039
'assets_version' => 'SomeVersionScheme',

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_full.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/deprecated_merge_partial.xml

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/full.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
77
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
88

9-
<framework:config secret="s3cr3t" ide="file%%link%%format" default-locale="fr" trust-proxy-headers="true" trusted-proxies="127.0.0.1, 10.0.0.1" http-method-override="false">
9+
<framework:config secret="s3cr3t" ide="file%%link%%format" default-locale="fr" trusted-proxies="127.0.0.1, 10.0.0.1" http-method-override="false">
1010
<framework:csrf-protection enabled="true" field-name="_csrf" />
1111
<framework:form />
1212
<framework:esi enabled="true" />

0 commit comments

Comments
 (0)