Skip to content

Commit 2807709

Browse files
Merge branch '2.7' into 2.8
* 2.7: [Bridge\ProxyManager] Dont call __destruct() on non-instantiated services bumped Symfony version to 2.7.34 updated VERSION for 2.7.33 update CONTRIBUTORS for 2.7.33 updated CHANGELOG for 2.7.33
2 parents 12dc1ce + e1ffb33 commit 2807709

File tree

9 files changed

+157
-17
lines changed

9 files changed

+157
-17
lines changed

CHANGELOG-2.7.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ 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.33 (2017-08-01)
11+
12+
* bug #22244 [Console] Fix passing options with defaultCommand (Jakub Sacha)
13+
* bug #23684 [Debug] Missing escape in debug output (c960657)
14+
* bug #23662 [VarDumper] Adapt to php 7.2 changes (nicolas-grekas)
15+
* bug #23649 [Form][TwigBridge] Don't render _method in form_rest() for a child form (fmarchalemisys)
16+
* bug #23619 [Validator] Fix IbanValidator for ukrainian IBANs (paroe)
17+
* bug #23238 [Security] ensure the 'route' index is set before attempting to use it (gsdevme)
18+
* bug #23580 Fix login redirect when referer contains a query string (fabpot)
19+
* bug #23574 [VarDumper] Move locale sniffing to dump() time (nicolas-grekas)
20+
1021
* 2.7.32 (2017-07-17)
1122

1223
* security #23507 [Security] validate empty passwords again (xabbuh)

CONTRIBUTORS.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ 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
- Maxime Steinhausser (ogizanagi)
23-
- Abdellatif Ait boudad (aitboudad)
2423
- Robin Chalas (chalas_r)
24+
- Abdellatif Ait boudad (aitboudad)
25+
- Grégoire Pineau (lyrixx)
2526
- Romain Neutron (romain)
2627
- Pascal Borreli (pborreli)
27-
- Grégoire Pineau (lyrixx)
2828
- Wouter De Jong (wouterj)
2929
- Joseph Bielawski (stloyd)
3030
- Karma Dordrak (drak)
@@ -34,8 +34,8 @@ Symfony is the result of the work of many people who made the code better
3434
- Jean-François Simon (jfsimon)
3535
- Benjamin Eberlei (beberlei)
3636
- Igor Wiedler (igorw)
37-
- Eriksen Costa (eriksencosta)
3837
- Roland Franssen (ro0)
38+
- Eriksen Costa (eriksencosta)
3939
- Jules Pietri (heah)
4040
- Sarah Khalil (saro0h)
4141
- Guilhem Niot (energetick)
@@ -66,14 +66,15 @@ Symfony is the result of the work of many people who made the code better
6666
- Eric Clemmons (ericclemmons)
6767
- Charles Sarrazin (csarrazi)
6868
- Christian Raue
69+
- Konstantin Myakshin (koc)
6970
- Arnout Boks (aboks)
7071
- Deni
7172
- Henrik Westphal (snc)
7273
- Dariusz Górecki (canni)
7374
- Jáchym Toušek (enumag)
7475
- Titouan Galopin (tgalopin)
7576
- Douglas Greenshields (shieldo)
76-
- Konstantin Myakshin (koc)
77+
- Dany Maillard (maidmaid)
7778
- Lee McDermott
7879
- Brandon Turner
7980
- Luis Cordova (cordoval)
@@ -89,23 +90,22 @@ Symfony is the result of the work of many people who made the code better
8990
- Fran Moreno (franmomu)
9091
- Antoine Hérault (herzult)
9192
- Paráda József (paradajozsef)
93+
- Issei Murasawa (issei_m)
9294
- Arnaud Le Blanc (arnaud-lb)
9395
- Maxime STEINHAUSSER
9496
- Alexander M. Turek (derrabus)
9597
- Michal Piotrowski (eventhorizon)
96-
- Dany Maillard (maidmaid)
97-
- Issei Murasawa (issei_m)
9898
- Tim Nagel (merk)
99+
- Yonel Ceruto González (yonelceruto)
99100
- Brice BERNARD (brikou)
100101
- Baptiste Clavié (talus)
101102
- Vladimir Reznichenko (kalessil)
102103
- marc.weistroff
103-
- Yonel Ceruto González (yonelceruto)
104104
- lenar
105+
- Tobias Nyholm (tobias)
105106
- Włodzimierz Gajda (gajdaw)
106107
- Alexander Schwenn (xelaris)
107108
- Jacob Dreesen (jdreesen)
108-
- Tobias Nyholm (tobias)
109109
- Florian Voutzinos (florianv)
110110
- Colin Frei
111111
- Adrien Brault (adrienbrault)
@@ -132,13 +132,13 @@ Symfony is the result of the work of many people who made the code better
132132
- Daniel Gomes (danielcsgomes)
133133
- Hidenori Goto (hidenorigoto)
134134
- Guilherme Blanco (guilhermeblanco)
135+
- David Maicher (dmaicher)
135136
- Pablo Godel (pgodel)
136137
- Jérémie Augustin (jaugustin)
137138
- Andréia Bohner (andreia)
138139
- Rafael Dohms (rdohms)
139140
- Arnaud Kleinpeter (nanocom)
140141
- jwdeitch
141-
- David Maicher (dmaicher)
142142
- Mikael Pajunen
143143
- Joel Wurtz (brouznouf)
144144
- Jérôme Vasseur (jvasseur)
@@ -175,6 +175,7 @@ Symfony is the result of the work of many people who made the code better
175175
- Dennis Benkert (denderello)
176176
- Benjamin Dulau (dbenjamin)
177177
- Mathieu Lemoine (lemoinem)
178+
- Christian Schmidt
178179
- Andreas Hucks (meandmymonkey)
179180
- Noel Guilbert (noel)
180181
- Stepan Anchugov (kix)
@@ -200,7 +201,6 @@ Symfony is the result of the work of many people who made the code better
200201
- John Kary (johnkary)
201202
- Justin Hileman (bobthecow)
202203
- Blanchon Vincent (blanchonvincent)
203-
- Christian Schmidt
204204
- Michele Orselli (orso)
205205
- Tom Van Looy (tvlooy)
206206
- Sven Paulus (subsven)
@@ -236,6 +236,7 @@ Symfony is the result of the work of many people who made the code better
236236
- Katsuhiro OGAWA
237237
- Patrick McDougle (patrick-mcdougle)
238238
- Alif Rachmawadi
239+
- Alessandro Chitolina
239240
- Kristen Gilden (kgilden)
240241
- Pierre-Yves LEBECQ (pylebecq)
241242
- Jordan Samouh (jordansamouh)
@@ -261,6 +262,8 @@ Symfony is the result of the work of many people who made the code better
261262
- Pavel Batanov (scaytrase)
262263
- Nikita Konstantinov
263264
- Wodor Wodorski
265+
- Rob Frawley 2nd (robfrawley)
266+
- Gregor Harlan (gharlan)
264267
- Thomas Lallement (raziel057)
265268
- Giorgio Premi
266269
- Matthieu Napoli (mnapoli)
@@ -276,7 +279,6 @@ Symfony is the result of the work of many people who made the code better
276279
- Marc Weistroff (futurecat)
277280
- Christian Schmidt
278281
- Hidde Wieringa (hiddewie)
279-
- Alessandro Chitolina
280282
- Chad Sikorra (chadsikorra)
281283
- Chris Smith (cs278)
282284
- Florian Klein (docteurklein)
@@ -313,7 +315,6 @@ Symfony is the result of the work of many people who made the code better
313315
- Thierry Thuon (lepiaf)
314316
- Ricard Clau (ricardclau)
315317
- Mark Challoner (markchalloner)
316-
- Gregor Harlan (gharlan)
317318
- Gennady Telegin (gtelegin)
318319
- Ben Davies (bendavies)
319320
- Erin Millard
@@ -322,7 +323,6 @@ Symfony is the result of the work of many people who made the code better
322323
- Magnus Nordlander (magnusnordlander)
323324
- alquerci
324325
- Francesco Levorato
325-
- Rob Frawley 2nd (robfrawley)
326326
- Vitaliy Zakharov (zakharovvi)
327327
- Tobias Sjösten (tobiassjosten)
328328
- Gyula Sallai (salla)
@@ -339,6 +339,7 @@ Symfony is the result of the work of many people who made the code better
339339
- Thomas Calvet (fancyweb)
340340
- Niels Keurentjes (curry684)
341341
- JhonnyL
342+
- David Badura (davidbadura)
342343
- hossein zolfi (ocean)
343344
- Clément Gautier (clementgautier)
344345
- Eduardo Gulias (egulias)
@@ -428,7 +429,6 @@ Symfony is the result of the work of many people who made the code better
428429
- Christian Wahler
429430
- Gintautas Miselis
430431
- Rob Bast
431-
- David Badura (davidbadura)
432432
- Zander Baldwin
433433
- Adam Harvey
434434
- Maxime Veber (nek-)
@@ -543,6 +543,7 @@ Symfony is the result of the work of many people who made the code better
543543
- Max Rath (drak3)
544544
- Stéphane Escandell (sescandell)
545545
- Konstantin S. M. Möllers (ksmmoellers)
546+
- James Johnston
546547
- Sinan Eldem
547548
- Alexandre Dupuy (satchette)
548549
- Andre Rømcke (andrerom)
@@ -591,6 +592,7 @@ Symfony is the result of the work of many people who made the code better
591592
- Ulumuddin Yunus (joenoez)
592593
- Luc Vieillescazes (iamluc)
593594
- Johann Saunier (prophet777)
595+
- Valentin Udaltsov (vudaltsov)
594596
- Michael Devery (mickadoo)
595597
- Antoine Corcy
596598
- Artur Eshenbrener
@@ -909,6 +911,7 @@ Symfony is the result of the work of many people who made the code better
909911
- Alex Demchenko (pilot)
910912
- Tadas Gliaubicas (tadcka)
911913
- Benoit Garret
914+
- Jakub Sacha
912915
- DerManoMann
913916
- Olaf Klischat
914917
- orlovv
@@ -1173,6 +1176,7 @@ Symfony is the result of the work of many people who made the code better
11731176
- Malte Wunsch
11741177
- wusuopu
11751178
- povilas
1179+
- Gavin Staniforth
11761180
- Alessandro Tagliapietra (alex88)
11771181
- Biji (biji)
11781182
- Gunnar Lium (gunnarlium)
@@ -1234,6 +1238,7 @@ Symfony is the result of the work of many people who made the code better
12341238
- flack
12351239
- izzyp
12361240
- František Bereň
1241+
- Mike Francis
12371242
- Christoph Nissle (derstoffel)
12381243
- Ionel Scutelnicu (ionelscutelnicu)
12391244
- Nicolas Tallefourtané (nicolab)
@@ -1244,6 +1249,7 @@ Symfony is the result of the work of many people who made the code better
12441249
- jjanvier
12451250
- Julius Beckmann
12461251
- Romain Dorgueil
1252+
- Christopher Parotat
12471253
- Grayson Koonce (breerly)
12481254
- Fabien LUCAS (flucas2)
12491255
- Indra Gunawan (indragunawan)
@@ -1535,11 +1541,13 @@ Symfony is the result of the work of many people who made the code better
15351541
- Ladislav Tánczos
15361542
- Brian Freytag
15371543
- Skorney
1544+
- fmarchalemisys
15381545
- mieszko4
15391546
- Steve Preston
15401547
- Neophy7e
15411548
- bokonet
15421549
- Arrilot
1550+
- Shaun Simmons
15431551
- Markus Staab
15441552
- Pierre-Louis LAUNAY
15451553
- djama
@@ -1568,6 +1576,7 @@ Symfony is the result of the work of many people who made the code better
15681576
- Penny Leach
15691577
- Richard Trebichavský
15701578
- g123456789l
1579+
- Jonathan Vollebregt
15711580
- oscartv
15721581
- DanSync
15731582
- Peter Zwosta
@@ -1680,7 +1689,6 @@ Symfony is the result of the work of many people who made the code better
16801689
- Moritz Kraft (userfriendly)
16811690
- Víctor Mateo (victormateo)
16821691
- Vincent (vincent1870)
1683-
- Valentin Udaltsov (vudaltsov)
16841692
- Eugene Babushkin (warl)
16851693
- Wouter Sioen (wouter_sioen)
16861694
- Xavier Amado (xamado)
@@ -1702,6 +1710,7 @@ Symfony is the result of the work of many people who made the code better
17021710
- Sergey Fedotov
17031711
- Michael
17041712
1713+
- AbdElKader Bouadjadja
17051714
- Jan Emrich
17061715
- Mark Topper
17071716
- Xavier REN
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bridge\ProxyManager\LazyProxy\Instantiator;
13+
14+
use ProxyManager\Factory\LazyLoadingValueHolderFactory as BaseFactory;
15+
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\LazyLoadingValueHolderGenerator;
16+
17+
/**
18+
* @internal
19+
*/
20+
class LazyLoadingValueHolderFactoryV1 extends BaseFactory
21+
{
22+
private $generatorV1;
23+
24+
/**
25+
* {@inheritdoc}
26+
*/
27+
protected function getGenerator()
28+
{
29+
return $this->generatorV1 ?: $this->generatorV1 = new LazyLoadingValueHolderGenerator();
30+
}
31+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bridge\ProxyManager\LazyProxy\Instantiator;
13+
14+
use ProxyManager\ProxyGenerator\ProxyGeneratorInterface;
15+
use ProxyManager\Factory\LazyLoadingValueHolderFactory as BaseFactory;
16+
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\LazyLoadingValueHolderGenerator;
17+
18+
/**
19+
* @internal
20+
*/
21+
class LazyLoadingValueHolderFactoryV2 extends BaseFactory
22+
{
23+
private $generator;
24+
25+
/**
26+
* {@inheritdoc}
27+
*/
28+
protected function getGenerator(): ProxyGeneratorInterface
29+
{
30+
return $this->generator ?: $this->generator = new LazyLoadingValueHolderGenerator();
31+
}
32+
}

src/Symfony/Bridge/ProxyManager/LazyProxy/Instantiator/RuntimeInstantiator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ public function __construct()
3636
$config = new Configuration();
3737
$config->setGeneratorStrategy(new EvaluatingGeneratorStrategy());
3838

39-
$this->factory = new LazyLoadingValueHolderFactory($config);
39+
if (method_exists('ProxyManager\Version', 'getVersion')) {
40+
$this->factory = new LazyLoadingValueHolderFactoryV2($config);
41+
} else {
42+
$this->factory = new LazyLoadingValueHolderFactoryV1($config);
43+
}
4044
}
4145

4246
/**
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper;
13+
14+
use ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerator as BaseGenerator;
15+
use Zend\Code\Generator\ClassGenerator;
16+
17+
/**
18+
* @internal
19+
*/
20+
class LazyLoadingValueHolderGenerator extends BaseGenerator
21+
{
22+
/**
23+
* {@inheritdoc}
24+
*/
25+
public function generate(\ReflectionClass $originalClass, ClassGenerator $classGenerator)
26+
{
27+
parent::generate($originalClass, $classGenerator);
28+
29+
if ($classGenerator->hasMethod('__destruct')) {
30+
$destructor = $classGenerator->getMethod('__destruct');
31+
$body = $destructor->getBody();
32+
$newBody = preg_replace('/^(\$this->initializer[a-zA-Z0-9]++) && .*;\n\nreturn (\$this->valueHolder)/', '$1 || $2', $body);
33+
34+
if ($body === $newBody) {
35+
throw new \UnexpectedValueException(sprintf('Unexpected lazy-proxy format generated for method %s::__destruct()', $originalClass->name));
36+
}
37+
38+
$destructor->setBody($newBody);
39+
}
40+
}
41+
}

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php

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

1414
use ProxyManager\Generator\ClassGenerator;
1515
use ProxyManager\GeneratorStrategy\BaseGeneratorStrategy;
16-
use ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerator;
1716
use Symfony\Component\DependencyInjection\Container;
1817
use Symfony\Component\DependencyInjection\ContainerInterface;
1918
use Symfony\Component\DependencyInjection\Definition;

0 commit comments

Comments
 (0)