Skip to content

Commit 22723da

Browse files
committed
Merge branch '3.2' into 3.3
* 3.2: (42 commits) 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 render hidden _method field in form_rest() Add Doctrine Cache to dev dependencies to fix failing unit tests. return fallback locales whenever possible [Console] Fix catching exception type in QuestionHelper [WebProfilerBundle] Eliminate line wrap on count columnt (routing) [Routing] Fix XmlFileLoader exception message [Translation] Fix FileLoader::loadResource() php doc Sessions: configurable "use_strict_mode" option for NativeSessionStorage [FrameworkBundle] [Command] Clean bundle directory, fixes symfony#23177 Reset redirectCount when throwing exception [TwigBundle] Remove template.xml services when templating is disabled add content-type header on exception response Embedding a response that combines expiration and validation, that should not defeat expiration on the combined response fixed bad merge Fix two edge cases in ResponseCacheStrategy [Routing] Expose request in route conditions, if needed and possible [Routing] Expose request in route conditions, if needed and possible ...
2 parents 7bb72b0 + 80b114e commit 22723da

File tree

49 files changed

+449
-75
lines changed

Some content is hidden

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

49 files changed

+449
-75
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)

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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"fig/link-util": "^1.0",
2424
"symfony/asset": "~2.8|~3.0",
2525
"symfony/finder": "~2.8|~3.0",
26-
"symfony/form": "^3.2.7",
26+
"symfony/form": "^3.2.10|^3.3.3",
2727
"symfony/http-kernel": "~3.2",
2828
"symfony/polyfill-intl-icu": "~1.0",
2929
"symfony/routing": "~2.8|~3.0",
@@ -38,6 +38,9 @@
3838
"symfony/expression-language": "~2.8|~3.0",
3939
"symfony/web-link": "~3.3"
4040
},
41+
"conflict": {
42+
"symfony/form": "<3.2.10|~3.3,<3.3.3"
43+
},
4144
"suggest": {
4245
"symfony/finder": "",
4346
"symfony/asset": "For using the AssetExtension",

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/Command/CacheClearCommand.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = tr
158158
$safeTempKernel = str_replace('\\', '\\\\', get_class($tempKernel));
159159
$realKernelFQN = get_class($realKernel);
160160

161-
foreach (Finder::create()->files()->name('*.meta')->in($warmupDir) as $file) {
161+
foreach (Finder::create()->files()->depth('<3')->name('*.meta')->in($warmupDir) as $file) {
162162
file_put_contents($file, preg_replace(
163163
'/(C\:\d+\:)"'.$safeTempKernel.'"/',
164164
sprintf('$1"%s"', $realKernelFQN),
@@ -170,14 +170,16 @@ protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = tr
170170
$search = array($warmupDir, str_replace('\\', '\\\\', $warmupDir));
171171
$replace = str_replace('\\', '/', $realCacheDir);
172172
foreach (Finder::create()->files()->in($warmupDir) as $file) {
173-
$content = str_replace($search, $replace, file_get_contents($file));
174-
file_put_contents($file, $content);
173+
$content = str_replace($search, $replace, file_get_contents($file), $count);
174+
if ($count) {
175+
file_put_contents($file, $content);
176+
}
175177
}
176178

177179
// fix references to container's class
178180
$tempContainerClass = get_class($tempKernel->getContainer());
179181
$realContainerClass = get_class($realKernel->getContainer());
180-
foreach (Finder::create()->files()->name($tempContainerClass.'*')->in($warmupDir) as $file) {
182+
foreach (Finder::create()->files()->depth('<2')->name($tempContainerClass.'*')->in($warmupDir) as $file) {
181183
$content = str_replace($tempContainerClass, $realContainerClass, file_get_contents($file));
182184
file_put_contents($file, $content);
183185
rename($file, str_replace(DIRECTORY_SEPARATOR.$tempContainerClass, DIRECTORY_SEPARATOR.$realContainerClass, $file));

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
435435
->scalarNode('gc_divisor')->end()
436436
->scalarNode('gc_probability')->defaultValue(1)->end()
437437
->scalarNode('gc_maxlifetime')->end()
438+
->booleanNode('use_strict_mode')->end()
438439
->scalarNode('save_path')->defaultValue('%kernel.cache_dir%/sessions')->end()
439440
->integerNode('metadata_update_threshold')
440441
->defaultValue('0')

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ private function registerSessionConfiguration(array $config, ContainerBuilder $c
702702
// session storage
703703
$container->setAlias('session.storage', $config['storage_id']);
704704
$options = array();
705-
foreach (array('name', 'cookie_lifetime', 'cookie_path', 'cookie_domain', 'cookie_secure', 'cookie_httponly', 'use_cookies', 'gc_maxlifetime', 'gc_probability', 'gc_divisor') as $key) {
705+
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) {
706706
if (isset($config[$key])) {
707707
$options[$key] = $config[$key];
708708
}

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/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,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<framework:csrf-protection field-name="_csrf"/>
1313
</framework:form>
1414
<framework:esi enabled="true" />
15+
<framework:ssi enabled="true" />
1516
<framework:profiler only-exceptions="true" enabled="false" />
1617
<framework:router resource="%kernel.root_dir%/config/routing.xml" type="xml" />
1718
<framework:session gc-maxlifetime="90000" gc-probability="1" gc-divisor="108" storage-id="session.storage.native" handler-id="session.handler.native_file" name="_SYMFONY" cookie-lifetime="86400" cookie-path="/" cookie-domain="example.com" cookie-secure="true" cookie-httponly="false" use-cookies="true" save-path="/path/to/sessions" />

0 commit comments

Comments
 (0)