Skip to content

Commit 011f569

Browse files
committed
Merge branch '3.4' into 4.0
* 3.4: fixed wrong merge Tweak message to be Flex friendly [Routing] fixed tests Fixing wrong class_exists on interface Preserve percent-encoding in URLs when performing redirects in the UrlMatcher [Console] Fix a bug when passing a letter that could be an alias add missing validation options to XSD file Take advantage of AnnotationRegistry::registerUniqueLoader [DI] Optimize Container::get() for perf fix merge Fix tests Refactoring tests.
2 parents 34eab4e + e586839 commit 011f569

11 files changed

+74
-10
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private function addCsrfSection(ArrayNodeDefinition $rootNode)
110110
$rootNode
111111
->children()
112112
->arrayNode('csrf_protection')
113-
->{!class_exists(FullStack::class) && class_exists(CsrfTokenManagerInterface::class) ? 'canBeDisabled' : 'canBeEnabled'}()
113+
->{!class_exists(FullStack::class) && interface_exists(CsrfTokenManagerInterface::class) ? 'canBeDisabled' : 'canBeEnabled'}()
114114
->end()
115115
->end()
116116
;

DependencyInjection/FrameworkExtension.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
1313

1414
use Doctrine\Common\Annotations\Reader;
15+
use Doctrine\Common\Annotations\AnnotationRegistry;
1516
use Symfony\Bridge\Monolog\Processor\DebugProcessor;
1617
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
1718
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
@@ -1072,6 +1073,11 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
10721073

10731074
$loader->load('annotations.xml');
10741075

1076+
if (!method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) {
1077+
$container->getDefinition('annotations.dummy_registry')
1078+
->setMethodCalls(array(array('registerLoader', array('class_exists'))));
1079+
}
1080+
10751081
if ('none' !== $config['cache']) {
10761082
if (!class_exists('Doctrine\Common\Cache\CacheProvider')) {
10771083
throw new LogicException('Annotations cannot be enabled as the Doctrine Cache library is not installed.');
@@ -1134,7 +1140,7 @@ private function registerSecurityCsrfConfiguration(array $config, ContainerBuild
11341140
}
11351141

11361142
if (!class_exists('Symfony\Component\Security\Csrf\CsrfToken')) {
1137-
throw new LogicException('CSRF support cannot be enabled as the Security CSRF component is not installed.');
1143+
throw new LogicException('CSRF support cannot be enabled as the Security CSRF component is not installed. Try running "composer require security-csrf".');
11381144
}
11391145

11401146
if (!$this->sessionConfigEnabled) {

Resources/config/annotations.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader">
1111
<call method="addGlobalIgnoredName">
1212
<argument>required</argument>
13-
<argument type="service">
14-
<!-- dummy arg to register class_exists as annotation loader only when required -->
15-
<service class="Doctrine\Common\Annotations\AnnotationRegistry">
16-
<call method="registerLoader">
17-
<argument>class_exists</argument>
18-
</call>
19-
</service>
20-
</argument>
13+
<!-- dummy arg to register class_exists as annotation loader only when required -->
14+
<argument type="service" id="annotations.dummy_registry" />
15+
</call>
16+
</service>
17+
18+
<service id="annotations.dummy_registry" class="Doctrine\Common\Annotations\AnnotationRegistry">
19+
<call method="registerUniqueLoader">
20+
<argument>class_exists</argument>
2121
</call>
2222
</service>
2323

Resources/config/schema/symfony-1.0.xsd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@
199199
<xsd:attribute name="cache" type="xsd:string" />
200200
<xsd:attribute name="enable-annotations" type="xsd:boolean" />
201201
<xsd:attribute name="static-method" type="xsd:boolean" />
202+
<xsd:attribute name="translation-domain" type="xsd:string" />
203+
<xsd:attribute name="strict-email" type="xsd:boolean" />
202204
</xsd:complexType>
203205

204206
<xsd:complexType name="file_mapping">
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
$container->loadFromExtension('framework', array(
4+
'validation' => array(
5+
'strict_email' => true,
6+
),
7+
));
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
$container->loadFromExtension('framework', array(
4+
'validation' => array(
5+
'translation_domain' => 'messages',
6+
),
7+
));
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" ?>
2+
<container xmlns="http://symfony.com/schema/dic/services"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:framework="http://symfony.com/schema/dic/symfony"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
6+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
7+
8+
<framework:config>
9+
<framework:validation strict-email="true" />
10+
</framework:config>
11+
</container>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" ?>
2+
<container xmlns="http://symfony.com/schema/dic/services"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xmlns:framework="http://symfony.com/schema/dic/symfony"
5+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
6+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
7+
8+
<framework:config>
9+
<framework:validation translation-domain="messages" />
10+
</framework:config>
11+
</container>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
framework:
2+
validation:
3+
strict_email: true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
framework:
2+
validation:
3+
translation_domain: messages

0 commit comments

Comments
 (0)