Skip to content

Commit dc73f9c

Browse files
committed
Merge branch '4.0'
* 4.0: 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 removed FIXME [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 99c5707 + 011f569 commit dc73f9c

11 files changed

+73
-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;
@@ -1093,6 +1094,11 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
10931094

10941095
$loader->load('annotations.xml');
10951096

1097+
if (!method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) {
1098+
$container->getDefinition('annotations.dummy_registry')
1099+
->setMethodCalls(array(array('registerLoader', array('class_exists'))));
1100+
}
1101+
10961102
if ('none' !== $config['cache']) {
10971103
if (!class_exists('Doctrine\Common\Cache\CacheProvider')) {
10981104
throw new LogicException('Annotations cannot be enabled as the Doctrine Cache library is not installed.');
@@ -1155,7 +1161,7 @@ private function registerSecurityCsrfConfiguration(array $config, ContainerBuild
11551161
}
11561162

11571163
if (!class_exists('Symfony\Component\Security\Csrf\CsrfToken')) {
1158-
throw new LogicException('CSRF support cannot be enabled as the Security CSRF component is not installed.');
1164+
throw new LogicException('CSRF support cannot be enabled as the Security CSRF component is not installed. Try running "composer require security-csrf".');
11591165
}
11601166

11611167
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@
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" />
202203
<xsd:attribute name="strict-email" type="xsd:boolean" />
203204
<xsd:attribute name="email-validation-mode" type="email-validation-mode" />
204205
</xsd:complexType>
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)