8000 Merge branch '3.4' · hhamon/symfony@22f6091 · GitHub
[go: up one dir, main page]

Skip to content

Commit 22f6091

Browse files
committed
Merge branch '3.4'
* 3.4: (83 commits) add missing version attribute Show exception is checked twice in ExceptionController of twig allow SSI fragments configuration in XML files Display a better error message when the toolbar cannot be displayed [SecurityBundle] Add user impersonation info and exit action to the profiler render hidden _method field in form_rest() Add Doctrine Cache to dev dependencies to fix failing unit tests. return fallback locales whenever possible Fix Predis client cluster with pipeline [Dotenv] Test load() with multiple paths [Console] Fix catching exception type in QuestionHelper Improved the exception page when there is no message [WebProfilerBundle] Eliminate line wrap on count columnt (routing) [Profiler][Validator] Add a validator panel in profiler [Validator] replace hardcoded service id [Routing] Fix XmlFileLoader exception message Remove duplicate changelog entries [DI] Dedup tags when using instanceof/autoconfigure [Translation] Fix FileLoader::loadResource() php doc [Serializer] Fix workaround min php version ...
2 parents 0a084dd + 265fc2a commit 22f6091

File tree

146 files changed

+2493
-305
lines changed

Some content is hidden

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

146 files changed

+2493
-305
lines changed

CONTRIBUTORS.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ Symfony is the result of the work of many people who made the code better
2020
- Javier Eguiluz (javier.eguiluz)
2121
- Hugo Hamon (hhamon)
2222
- Abdellatif Ait boudad (aitboudad)
23+
- Romain Neutron (romain)
2324
- Pascal Borreli (pborreli)
2425
- Wouter De Jong (wouterj)
25-
- Romain Neutron (romain)
26-
- Grégoire Pineau (lyrixx)
2726
- Robin Chalas (chalas_r)
28-
- Joseph Bielawski (stloyd)
2927
- Maxime Steinhausser (ogizanagi)
28+
- Grégoire Pineau (lyrixx)
29+
- Joseph Bielawski (stloyd)
3030
- Karma Dordrak (drak)
3131
- Lukas Kahwe Smith (lsmith)
3232
- Martin Hasoň (hason)
@@ -72,8 +72,8 @@ Symfony is the result of the work of many people who made the code better
7272
- Dariusz Górecki (canni)
7373
- Titouan Galopin (tgalopin)
7474
- Douglas Greenshields (shieldo)
75-
- Konstantin Myakshin (koc)
7675
- Jáchym Toušek (enumag)
76+
- Konstantin Myakshin (koc)
7777
- Lee McDermott
7878
- Brandon Turner
7979
- Luis Cordova (cordoval)
@@ -112,10 +112,10 @@ Symfony is the result of the work of many people who made the code better
112112
- Jacob Dreesen (jdreesen)
113113
- Tobias Nyholm (tobias)
114114
- Tomáš Votruba (tomas_votruba)
115+
- Yonel Ceruto González (yonelceruto)
115116
- Fabien Pennequin (fabienpennequin)
116117
- Gordon Franke (gimler)
117118
- Eric GELOEN (gelo)
118-
- Yonel Ceruto González (yonelceruto)
119119
- Daniel Wehner (dawehner)
120120
- Tugdual Saunier (tucksaun)
121121
- Théo FIDRY (theofidry)
@@ -130,6 +130,7 @@ Symfony is the result of the work of many people who made the code better
130130
- Daniel Gomes (danielcsgomes)
131131
- Hidenori Goto (hidenorigoto)
132132
- Guilherme Blanco (guilhermeblanco)
133+
- Vincent AUBERT (vincent)
133134
- Pablo Godel (pgodel)
134135
- Jérémie Augustin (jaugustin)
135136
- Andréia Bohner (andreia)
@@ -140,18 +141,17 @@ Symfony is the result of the work of many people who made the code better
140141
- Joel Wurtz (brouznouf)
141142
- Philipp Wahala (hifi)
142143
- Vyacheslav Pavlov
144+
- Richard van Laak (rvanlaak)
143145
- Javier Spagnoletti (phansys)
144146
- Richard Shank (iampersistent)
145147
- Thomas Rabaix (rande)
146-
- Vincent AUBERT (vincent)
147148
- Rouven Weßling (realityking)
148149
- Teoh Han Hui (teohhanhui)
149150
- Jérôme Vasseur (jvasseur)
150151
- Clemens Tolboom
151152
- Helmer Aaviksoo
152153
- Grégoire Paris (greg0ire)
153154
- Hiromi Hishida (77web)
154-
- Richard van Laak (rvanlaak)
155155
- Matthieu Ouellette-Vachon (maoueh)
156156
- Michał Pipa (michal.pipa)
157157
- Amal Raghav (kertz)
@@ -244,6 +244,7 @@ Symfony is the result of the work of many people who made the code better
244244
- Uwe Jäger (uwej711)
245245
- Eugene Leonovich (rybakit)
246246
- Filippo Tessarotto
247+
- Oleg Voronkovich
247248
- Joseph Rouff (rouffj)
248249
- Félix Labrecque (woodspire)
249250
- GordonsLondon
@@ -279,7 +280,6 @@ Symfony is the result of the work of many people who made the code better
279280
- Jordan Samouh (jordansamouh)
280281
- Chris Smith (cs278)
281282
- Florian Klein (docteurklein)
282-
- Oleg Voronkovich
283283
- Manuel Kiessling (manuelkiessling)
284284
- Atsuhiro KUBO (iteman)
285285
- Andrew Moore (finewolf)
@@ -389,6 +389,7 @@ Symfony is the result of the work of many people who made the code better
389389
- Emanuele Gaspari (inmarelibero)
390390
- Sébastien Santoro (dereckson)
391391
- Brian King
392+
- Frank de Jonge (frenkynet)
392393
- Michel Salib (michelsalib)
393394
- geoffrey
394395
- Steffen Roßkamp
@@ -525,7 +526,6 @@ Symfony is the result of the work of many people who made the code better
525526
- Romain Pierre (romain-pierre)
526527
- Jan Behrens
527528
- Mantas Var (mvar)
528-
- Frank de Jonge (frenkynet)
529529
- Sebastian Krebs
530530
- Jean-Christophe Cuvelier [Artack]
531531
- Christopher Davis (chrisguitarguy)
@@ -1280,6 +1280,7 @@ Symfony is the result of the work of many people who made the code better
12801280
- ged15
12811281
- Daan van Renterghem
12821282
- Nicole Cordes
1283+
- Martin Kirilov
12831284
- Bram Van der Sype (brammm)
12841285
- Christopher Hertel (chertel)
12851286
- Guile (guile)

UPGRADE-3.4.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Finder
1010
------
1111

1212
* The `Symfony\Component\Finder\Iterator\FilterIterator` class has been
13-
deprecated and will be removed in 4.0 as it used to fix a bug which existed
13+
deprecated and will be removed in 4.0 as it used to fix a bug which existed
1414
before version 5.5.23/5.6.7.
1515

1616
FrameworkBundle
@@ -47,10 +47,19 @@ Process
4747
SecurityBundle
4848
--------------
4949

50+
* Using voters that do not implement the `VoterInterface`is now deprecated in
51+
the `AccessDecisionManager` and this functionality will be removed in 4.0.
52+
5053
* `FirewallContext::getListeners()` now returns `\Traversable|array`
5154

5255
Validator
5356
---------
5457

5558
* Not setting the `strict` option of the `Choice` constraint to `true` is
5659
deprecated and will throw an exception in Symfony 4.0.
60+
61+
Yaml
62+
----
63+
64+
* Using the non-specific tag `!` is deprecated and will have a different
65+
behavior in 4.0. Use a plain integer or `!!float` instead.

UPGRADE-4.0.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,3 +702,6 @@ Yaml
702702

703703
* The constructor arguments `$offset`, `$totalNumberOfLines` and
704704
`$skippedLineNumbers` of the `Parser` class were removed.
705+
706+
* The behavior of the non-specific tag `!` is changed and now forces
707+
non-evaluating your values.

src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@
302302
{%- endblock form -%}
303303

304304
{%- block form_start -%}
305+
{%- do form.setMethodRendered() -%}
305306
{% set method = method|upper %}
306307
{%- if method in ["GET", "POST"] -%}
307308
{% set form_method = method %}
@@ -337,6 +338,20 @@
337338
{{- form_row(child) -}}
338339
{% endif %}
339340
{%- endfor %}
341+
342+
{% if not form.methodRendered %}
343+
{%- do form.setMethodRendered() -%}
344+
{% set method = method|upper %}
345+
{%- if method in ["GET", "POST"] -%}
346+
{% set form_method = method %}
347+
{%- else -%}
348+
{% set form_method = "POST" %}
349+
{%- endif -%}
350+
351+
{%- if form_method != method -%}
352+
<input type="hidden" name="_method" value="{{ method }}" />
353+
{%- endif -%}
354+
{% endif %}
340355
{% endblock form_rest %}
341356

342357
{# Support #}

src/Symfony/Bridge/Twig/composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
"symfony/expression-language": "~3.4|~4.0",
3939
"symfony/web-link": "~3.4|~4.0"
4040
},
41+
"conflict": {
42+
"symfony/form": "<3.4"
43+
},
4144
"suggest": {
4245
"symfony/finder": "",
4346
"symfony/asset": "For using the AssetExtension",

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ CHANGELOG
2525

2626
* Removed `doctrine/cache` from the list of required dependencies in `composer.json`
2727
* Deprecated `validator.mapping.cache.doctrine.apc` service
28-
* Deprecated using the `KERNEL_DIR` environment variable with `KernelTestCase::getKernelClass()`.
29-
* Deprecated the `KernelTestCase::getPhpUnitXmlDir()` and `KernelTestCase::getPhpUnitCliConfigArgument()` methods.
3028
* The `symfony/stopwatch` dependency has been removed, require it via `composer
3129
require symfony/stopwatch` in your `dev` environment.
3230
* Deprecated using the `KERNEL_DIR` environment variable with `KernelTestCase::getKernelClass()`.

src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
114114
$rows = array();
115115
$copyUsed = false;
116116
$exitCode = 0;
117+
$validAssetDirs = array();
117118
/** @var BundleInterface $bundle */
118119
foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) {
119120
if (!is_dir($originDir = $bundle->getPath().'/Resources/public')) {
@@ -152,6 +153,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
152153
$exitCode = 1;
153154
$rows[] = array(sprintf('<fg=red;options=bold>%s</>', '\\' === DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */), $message, $e->getMessage());
154155
}
156+
$validAssetDirs[] = $targetDir;
157+
}
158+
// remove the assets of the bundles that no longer exist
159+
foreach (new \FilesystemIterator($bundlesDir) as $dir) {
160+
if (!in_array($dir, $validAssetDirs)) {
161+
$filesystem->remove($dir);
162+
}
155163
}
156164

157165
$io->table(array('', 'Bundle', 'Method / Error'), $rows);

src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface;
1717
use Symfony\Component\Form\FormFactoryInterface;
1818
use Symfony\Component\HttpFoundation\RequestStack;
19-
use Symfony\Component\HttpFoundation\Session\Session;
2019
use Symfony\Component\HttpFoundation\Session\SessionInterface;
2120
use Symfony\Component\HttpKernel\HttpKernelInterface;
2221
use Symfony\Component\Routing\RouterInterface;
@@ -36,7 +35,10 @@ abstract class AbstractController implements ServiceSubscriberInterface
3635
{
3736
use ControllerTrait;
3837

39-
private $container;
38+
/**
39+
* @var ContainerInterface
40+
*/
41+
protected $container;
4042

4143
/**
4244
* @internal

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
402402
->scalarNode('gc_divisor')->end()
403403
->scalarNode('gc_probability')->defaultValue(1)->end()
404404
->scalarNode('gc_maxlifetime')->end()
405+
->booleanNode('use_strict_mode')->end()
405406
->scalarNode('save_path')->defaultValue('%kernel.cache_dir%/sessions')->end()
406407
->integerNode('metadata_update_threshold')
407408
->defaultValue('0')

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class FrameworkExtension extends Extension
7979
private $translationConfigEnabled = false;
8080
private $sessionConfigEnabled = false;
8181
private $annotationsConfigEnabled = false;
82+
private $validatorConfigEnabled = false;
8283

8384
/**
8485
* @var string|null
@@ -395,6 +396,10 @@ private function registerProfilerConfiguration(array $config, ContainerBuilder $
395396
$loader->load('form_debug.xml');
396397
}
397398

399+
if ($this->validatorConfigEnabled) {
400+
$loader->load('validator_debug.xml');
401+
}
402+
398403
if ($this->translationConfigEnabled) {
399404
$loader->load('translation_debug.xml');
400405
$container->getDefinition('translator.data_collector')->setDecoratedService('translator');
@@ -672,7 +677,7 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
672677
// session storage
673678
$container->setAlias('session.storage', $config['storage_id']);
674679
$options = array();
675-
foreach (array('name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'use_cookies', 'gc_maxlifetime', 'gc_probability', 'gc_divisor') as $key) {
680+
foreach (array('name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'use_cookies', 'gc_maxlifetime', 'gc_probability', 'gc_divisor', 'use_strict_mode') as $key) {
676681
if (isset($config[$key])) {
677682
$options[$key] = $config[$key];
678683
}
@@ -997,7 +1002,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
9971002
*/
9981003
private function registerValidationConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
9991004
{
1000-
if (!$this->isConfigEnabled($container, $config)) {
1005+
if (!$this->validatorConfigEnabled = $this->isConfigEnabled($container, $config)) {
10011006
return;
10021007
}
10031008

@@ -1067,7 +1072,10 @@ private function registerValidatorMapping(ContainerBuilder $container, array $co
10671072
foreach ($container->getParameter('kernel.bundles_metadata') as $bundle) {
10681073
$dirname = $bundle['path'];
10691074

1070-
if ($container->fileExists($file = $dirname.'/Resources/config/validation.yml', false)) {
1075+
if (
1076+
$container->fileExists($file = $dirname.'/Resources/config/validation.yaml', false) ||
1077+
$container->fileExists($file = $dirname.'/Resources/config/validation.yml', false)
1078+
) {
10711079
$fileRecorder('yml', $file);
10721080
}
10731081

@@ -1268,7 +1276,10 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
12681276
$fileRecorder('xml', $file);
12691277
}
12701278

1271-
if ($container->fileExists($file = $dirname.'/Resources/config/serialization.yml', false)) {
1279+
if (
1280+
$container->fileExists($file = $dirname.'/Resources/config/serialization.yaml', false) ||
1281+
$container->fileExists($file = $dirname.'/Resources/config/serialization.yml', false)
1282+
) {
12721283
$fileRecorder('yml', $file);
12731284
}
12741285

src/Symfony/Bundle/FrameworkBundle/HttpCache/HttpCache.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ public function __construct(HttpKernelInterface $kernel, $cacheDir = null)
5454
protected function forward(Request $request, $raw = false, Response $entry = null)
5555
{
5656
$this->getKernel()->boot();
57-
$this->getKernel()->getContainer()->set('cache', $this);
58-
$this->getKernel()->getContainer()->set($this->getSurrogate()->getName(), $this->getSurrogate());
57+
$this->getKernel()->getContainer()->set('cache', $this); // to be removed in 4.0?
5958
6059
return parent::forward($request, $raw, $entry);
6160
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<xsd:element name="form" type="form" minOccurs="0" maxOccurs="1" />
1414
<xsd:element name="csrf-protection" type="csrf_protection" minOccurs="0" maxOccurs="1" />
1515
<xsd:element name="esi" type="esi" minOccurs="0" maxOccurs="1" />
16+
<xsd:element name="ssi" type="ssi" minOccurs="0" maxOccurs="1" />
1617
<xsd:element name="fragments" type="fragments" minOccurs="0" maxOccurs="1" />
1718
<xsd:element name="web-link" type="web_link" minOccurs="0" maxOccurs="1" />
1819
<xsd:element name="profiler" type="profiler" minOccurs="0" maxOccurs="1" />
@@ -58,6 +59,10 @@
5859
<xsd:attribute name="enabled" type="xsd:boolean" />
5960
</xsd:complexType>
6061

62+
<xsd:complexType name="ssi">
63+
<xsd:attribute name="enabled" type="xsd:boolean" />
64+
</xsd:complexType>
65+
6166
<xsd:complexType name="fragments">
6267
<xsd:attribute name="enabled" type="xsd:boolean" />
6368
<xsd:attribute name="path" type="xsd:string" />
@@ -110,6 +115,7 @@
110115
<xsd:attribute name="gc-maxlifetime" type="xsd:string" />
111116
<xsd:attribute name="gc-divisor" type="xsd:string" />
112117
<xsd:attribute name="gc-probability" type="xsd:string" />
118+
<xsd:attribute name="use-strict-mode" type="xsd:boolean" />
113119
<xsd:attribute name="save-path" type="xsd:string" />
114120
</xsd:complexType>
115121

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</service>
3434

3535
<service id="translation.loader.yml" class="Symfony\Component\Translation\Loader\YamlFileLoader" public="true">
36-
<tag name="translation.loader" alias="yml" />
36+
<tag name="translation.loader" alias="yaml" legacy-alias="yml" />
3737
</service>
3838

3939
<service id="translation.loader.xliff" class="Symfony\Component\Translation\Loader\XliffFileLoader" public="true">
@@ -92,6 +92,11 @@
9292
<tag name="translation.dumper" alias="yml" />
9393
</service>
9494

95+
<service id="translation.dumper.yaml" class="Symfony\Component\Translation\Dumper\YamlFileDumper">
96+
<argument>yaml</argument>
97+
<tag name="translation.dumper" alias="yaml" />
98+
</service>
99+
95100
<service id="translation.dumper.qt" class="Symfony\Component\Translation\Dumper\QtFileDumper" public="true">
96101
<tag name="translation.dumper" alias="ts" />
97102
</service>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
6+
7+
<services>
8+
<defaults public="false" />
9+
10+
<service id="debug.validator" decorates="validator" decoration-priority="255" class="Symfony\Component\Validator\Validator\TraceableValidator">
11+
<argument type="service" id="debug.validator.inner" />
12+
</service>
13+
14+
<!-- DataCollector -->
15+
<service id="data_collector.validator" class="Symfony\Component\Validator\DataCollector\ValidatorDataCollector">
16+
<argument type="service" id="debug.validator"/>
17+
<tag name="data_collector" template="@WebProfiler/Collector/validator.html.twig" id="validator" priority="320" />
18+
</service>
19+
</services>
20+
</container>

src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Psr\Container\ContainerInterface;
1515
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
16-
use Symfony\Component\HttpFoundation\File\File;
1716

1817
class AbstractControllerTest extends ControllerTraitTest
1918
{

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
'esi' => array(
1414
'enabled' => true,
1515
),
16+
'ssi' => array(
17+
'enabled' => true,
18+
),
1619
'profiler' => array(
1720
'only_exceptions' => true,
1821
'enabled' => false,

0 commit comments

Comments
 (0)
0