Skip to content

Commit 6735b35

Browse files
Merge branch '2.7' into 2.8
* 2.7: allow to configure custom formats in XML configs require the XML PHP extension Fixed absolute url generation for query strings and hash urls bumped Symfony version to 2.7.32 [Filesystem] Dont copy perms when origin is remote updated VERSION for 2.7.31 update CONTRIBUTORS for 2.7.31 updated CHANGELOG for 2.7.31
2 parents 26ad2ad + 05e3332 commit 6735b35

File tree

13 files changed

+120
-13
lines changed

13 files changed

+120
-13
lines changed

CHANGELOG-2.7.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ in 2.7 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.7.0...v2.7.1
99

10+
* 2.7.31 (2017-07-05)
11+
12+
* bug #23378 [FrameworkBundle] Do not remove files from assets dir (1ed)
13+
1014
* 2.7.30 (2017-07-03)
1115

1216
* bug #23341 [DoctrineBridge][Security][Validator] do not validate empty values (xabbuh)

CONTRIBUTORS.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ Symfony is the result of the work of many people who made the code better
7070
- Deni
7171
- Henrik Westphal (snc)
7272
- Dariusz Górecki (canni)
73+
- Jáchym Toušek (enumag)
7374
- Titouan Galopin (tgalopin)
7475
- Douglas Greenshields (shieldo)
75-
- Jáchym Toušek (enumag)
7676
- Konstantin Myakshin (koc)
7777
- Lee McDermott
7878
- Brandon Turner
@@ -99,19 +99,19 @@ Symfony is the result of the work of many people who made the code better
9999
- Baptiste Clavié (talus)
100100
- Vladimir Reznichenko (kalessil)
101101
- marc.weistroff
102+
- Yonel Ceruto González (yonelceruto)
102103
- lenar
103104
- Włodzimierz Gajda (gajdaw)
104-
- Yonel Ceruto González (yonelceruto)
105105
- Alexander Schwenn (xelaris)
106106
- Jacob Dreesen (jdreesen)
107+
- Tobias Nyholm (tobias)
107108
- Florian Voutzinos (florianv)
108109
- Colin Frei
109110
- Adrien Brault (adrienbrault)
110111
- Joshua Thijssen
111112
- Peter Kokot (maastermedia)
112113
- David Buchmann (dbu)
113114
- excelwebzone
114-
- Tobias Nyholm (tobias)
115115
- Tomáš Votruba (tomas_votruba)
116116
- Fabien Pennequin (fabienpennequin)
117117
- Gordon Franke (gimler)
@@ -133,12 +133,15 @@ Symfony is the result of the work of many people who made the code better
133133
- Guilherme Blanco (guilhermeblanco)
134134
- Pablo Godel (pgodel)
135135
- Jérémie Augustin (jaugustin)
136+
- Dany Maillard (maidmaid)
136137
- Andréia Bohner (andreia)
137138
- Rafael Dohms (rdohms)
138139
- Arnaud Kleinpeter (nanocom)
139140
- jwdeitch
141+
- David Maicher (dmaicher)
140142
- Mikael Pajunen
141143
- Joel Wurtz (brouznouf)
144+
- Grégoire Paris (greg0ire)
142145
- Philipp Wahala (hifi)
143146
- Vyacheslav Pavlov
144147
- Richard van Laak (rvanlaak)
@@ -147,11 +150,9 @@ Symfony is the result of the work of many people who made the code better
147150
- Thomas Rabaix (rande)
148151
- Rouven Weßling (realityking)
149152
- Teoh Han Hui (teohhanhui)
150-
- David Maicher (dmaicher)
151153
- Jérôme Vasseur (jvasseur)
152154
- Clemens Tolboom
153155
- Helmer Aaviksoo
154-
- Grégoire Paris (greg0ire)
155156
- Hiromi Hishida (77web)
156157
- Matthieu Ouellette-Vachon (maoueh)
157158
- Michał Pipa (michal.pipa)
@@ -234,7 +235,6 @@ Symfony is the result of the work of many people who made the code better
234235
- Arjen Brouwer (arjenjb)
235236
- Katsuhiro OGAWA
236237
- Patrick McDougle (patrick-mcdougle)
237-
- Dany Maillard (maidmaid)
238238
- Alif Rachmawadi
239239
- Kristen Gilden (kgilden)
240240
- Pierre-Yves LEBECQ (pylebecq)
@@ -620,6 +620,7 @@ Symfony is the result of the work of many people who made the code better
620620
- develop
621621
- ReenExe
622622
- Mark Sonnabaum
623+
- Maxime Veber (nek-)
623624
- Richard Quadling
624625
- jochenvdv
625626
- Arturas Smorgun (asarturas)
@@ -642,6 +643,7 @@ Symfony is the result of the work of many people who made the code better
642643
- Trent Steel (trsteel88)
643644
- Yuen-Chi Lian
644645
- Besnik Br
646+
- Jose Gonzalez
645647
- Dariusz Ruminski
646648
- Joshua Nye
647649
- Claudio Zizza
@@ -1081,7 +1083,6 @@ Symfony is the result of the work of many people who made the code better
10811083
- Max Summe
10821084
- WedgeSama
10831085
- Felds Liscia
1084-
- Maxime Veber (nek-)
10851086
- Sullivan SENECHAL
10861087
- Tadcka
10871088
- Beth Binkovitz
@@ -1092,12 +1093,12 @@ Symfony is the result of the work of many people who made the code better
10921093
- Tomaz Ahlin
10931094
- Marcus Stöhr (dafish)
10941095
- Emmanuel Vella (emmanuel.vella)
1096+
- Adam Szaraniec (mimol)
10951097
- Carsten Nielsen (phreaknerd)
10961098
- Mathieu Rochette
10971099
- Jay Severson
10981100
- René Kerner
10991101
- Nathaniel Catchpole
1100-
- Jose Gonzalez
11011102
- Adrien Samson (adriensamson)
11021103
- Samuel Gordalina (gordalina)
11031104
- Max Romanovsky (maxromanovsky)
@@ -1258,6 +1259,7 @@ Symfony is the result of the work of many people who made the code better
12581259
- Aarón Nieves Fernández
12591260
- Mike Meier
12601261
- Kirill Saksin
1262+
- Julien Pauli
12611263
- Koalabaerchen
12621264
- michalmarcinkowski
12631265
- Warwick
@@ -1305,6 +1307,7 @@ Symfony is the result of the work of many people who made the code better
13051307
- klemens
13061308
- dened
13071309
- Dmitry Korotovsky
1310+
- mcorteel
13081311
- Michael van Tricht
13091312
- Sam Ward
13101313
- Walther Lalk
@@ -1335,6 +1338,7 @@ Symfony is the result of the work of many people who made the code better
13351338
- Jan Marek (janmarek)
13361339
- Mark de Haan (markdehaan)
13371340
- Dan Patrick (mdpatrick)
1341+
- Pedro Magalhães (pmmaga)
13381342
- Rares Vlaseanu (raresvla)
13391343
- tante kinast (tante)
13401344
- Vincent LEFORT (vlefort)
@@ -1542,6 +1546,7 @@ Symfony is the result of the work of many people who made the code better
15421546
- Abdulkadir N. A.
15431547
- Yevgen Kovalienia
15441548
- Lebnik
1549+
- Shude
15451550
- Ondřej Führer
15461551
- Sema
15471552
- Elan Ruusamäe

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=5.3.9",
20+
"ext-xml": "*",
2021
"doctrine/common": "~2.4",
2122
"twig/twig": "~1.34|~2.4",
2223
"psr/log": "~1.0",

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ public function generateAbsoluteUrl($path)
7272
$port = ':'.$this->requestContext->getHttpsPort();
7373
}
7474

75+
if ('#' === $path[0]) {
76+
$queryString = $this->requestContext->getQueryString();
77+
$path = $this->requestContext->getPathInfo().($queryString ? '?'.$queryString : '').$path;
78+
} elseif ('?' === $path[0]) {
79+
$path = $this->requestContext->getPathInfo().$path;
80+
}
81+
7582
if ('/' !== $path[0]) {
7683
$path = rtrim($this->requestContext->getBaseUrl(), '/').'/'.$path;
7784
}
@@ -82,6 +89,12 @@ public function generateAbsoluteUrl($path)
8289
return $path;
8390
}
8491

92+
if ('#' === $path[0]) {
93+
$path = $request->getRequestUri().$path;
94+
} elseif ('?' === $path[0]) {
95+
$path = $request->getPathInfo().$path;
96+
}
97+
8598
if (!$path || '/' !== $path[0]) {
8699
$prefix = $request->getPathInfo();
87100
$last = strlen($prefix) - 1;

src/Symfony/Bridge/Twig/Tests/Extension/HttpFoundationExtensionTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ public function getGenerateAbsoluteUrlData()
4242
array('http://example.com/baz', 'http://example.com/baz', '/'),
4343
array('https://example.com/baz', 'https://example.com/baz', '/'),
4444
array('//example.com/baz', '//example.com/baz', '/'),
45+
46+
array('http://localhost/foo/bar?baz', '?baz', '/foo/bar'),
47+
array('http://localhost/foo/bar?baz=1', '?baz=1', '/foo/bar?foo=1'),
48+
array('http://localhost/foo/baz?baz=1', 'baz?baz=1', '/foo/bar?foo=1'),
49+
50+
array('http://localhost/foo/bar#baz', '#baz', '/foo/bar'),
51+
array('http://localhost/foo/bar?0#baz', '#baz', '/foo/bar?0'),
52+
array('http://localhost/foo/bar?baz=1#baz', '?baz=1#baz', '/foo/bar?foo=1'),
53+
array('http://localhost/foo/baz?baz=1#baz', 'baz?baz=1#baz', '/foo/bar?foo=1'),
4554
);
4655
}
4756

src/Symfony/Bundle/DebugBundle/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=5.3.9",
20+
"ext-xml": "*",
2021
"symfony/http-kernel": "~2.6|~3.0.0",
2122
"symfony/twig-bridge": "~2.6|~3.0.0",
2223
"symfony/var-dumper": "~2.6|~3.0.0"

src/Symfony/Bundle/SecurityBundle/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=5.3.9",
20+
"ext-xml": "*",
2021
"symfony/security": "~2.8|~3.0.0",
2122
"symfony/security-acl": "~2.7|~3.0.0",
2223
"symfony/http-kernel": "~2.7|~3.0.0",

src/Symfony/Bundle/TwigBundle/Resources/config/schema/twig-1.0.xsd

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
<xsd:complexType name="config">
1111
<xsd:sequence>
12+
<xsd:element name="date" type="date" minOccurs="0" maxOccurs="1" />
13+
<xsd:element name="number-format" type="number_format" minOccurs="0" maxOccurs="1" />
14+
1215
<!-- @deprecated since version 2.6, to be removed in 3.0 -->
1316
<xsd:element name="form" type="form" minOccurs="0" maxOccurs="1" />
1417
<xsd:element name="form-theme" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
@@ -28,6 +31,18 @@
2831
<xsd:attribute name="exception-controller" type="xsd:string" />
2932
</xsd:complexType>
3033

34+
<xsd:complexType name="date">
35+
<xsd:attribute name="format" type="xsd:string" />
36+
<xsd:attribute name="interval-format" type="xsd:string" />
37+
<xsd:attribute name="timezone" type="xsd:string" />
38+
</xsd:complexType>
39+
40+
<xsd:complexType name="number_format">
41+
<xsd:attribute name="decimals" type="xsd:integer" />
42+
<xsd:attribute name="decimal-point" type="xsd:string" />
43+
<xsd:attribute name="thousands-separator" type="xsd:string" />
44+
</xsd:complexType>
45+
3146
<xsd:complexType name="form">
3247
<xsd:choice minOccurs="1" maxOccurs="unbounded">
3348
<xsd:element name="resource" type="xsd:string" />
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
$container->loadFromExtension('twig', array(
4+
'date' => array(
5+
'format' => 'Y-m-d',
6+
'interval_format' => '%d',
7+
'timezone' => 'Europe/Berlin',
8+
),
9+
'number_format' => array(
10+
'decimals' => 2,
11+
'decimal_point' => ',',
12+
'thousands_separator' => '.',
13+
),
14+
));
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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:twig="http://symfony.com/schema/dic/twig"
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/twig http://symfony.com/schema/dic/twig/twig-1.0.xsd">
7+
8+
<twig:config>
9+
<twig:date format="Y-m-d" interval-format="%d" timezone="Europe/Berlin" />
10+
<twig:number-format decimals="2" decimal-point="," thousands-separator="." />
11+
</twig:config>
12+
</container>

0 commit comments

Comments
 (0)