8000 Merge branch '2.8' into 3.2 · symfony/symfony@3306986 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3306986

Browse files
committed
Merge branch '2.8' into 3.2
* 2.8: fixed CS [2.8] Modify 2.8 upgrade doc - key option is deprecated. [DebugBundle] Reword an outdated comment about var dumper wiring [DI] Fix some docblocks Ignore memcached missing key error on dession destroy Github template: Remove EOM 3.2 from branch suggestion [Security] Fix security.interactive_login event const doc block Avoid infinite loops when profiler data is malformed [Bridge\ProxyManager] Dont call __destruct() on non-instantiated services Docblock improvement bumped Symfony version to 2.8.27 updated VERSION for 2.8.26 updated CHANGELOG for 2.8.26 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 [HttpFoundation] Generate safe fallback filename for wrongly encoded filename
2 parents 927f950 + 18e5e70 commit 3306986

19 files changed

+211
-33
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
| Q | A
22
| ------------- | ---
3-
| Branch? | 3.4 or master / 2.7, 2.8, 3.2 or 3.3 <!-- see comment below -->
3+
| Branch? | 3.4 or master / 2.7, 2.8 or 3.3 <!-- see comment below -->
44
| Bug fix? | yes/no
55
| New feature? | yes/no <!-- don't forget updating src/**/CHANGELOG.md files -->
66
| BC breaks? | yes/no

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)
@@ -176,6 +176,7 @@ Symfony is the result of the work of many people who made the code better
176176
- Benjamin Dulau (dbenjamin)
177177
- James Halsall (jaitsu)
178178
- Mathieu Lemoine (lemoinem)
179+
- Christian Schmidt
179180
- Andreas Hucks (meandmymonkey)
180181
- Noel Guilbert (noel)
181182
- Stepan Anchugov (kix)
@@ -201,7 +202,6 @@ Symfony is the result of the work of many people who made the code better
201202
- John Kary (johnkary)
202203
- Justin Hileman (bobthecow)
203204
- Blanchon Vincent (blanchonvincent)
204-
- Christian Schmidt
205205
- Michele Orselli (orso)
206206
- Tom Van Looy (tvlooy)
207207
- Sven Paulus (subsven)
@@ -238,6 +238,7 @@ Symfony is the result of the work of many people who made the code better
238238
- Katsuhiro OGAWA
239239
- Patrick McDougle (patrick-mcdo F42D ugle)
240240
- Alif Rachmawadi
241+
- Alessandro Chitolina
241242
- Kristen Gilden (kgilden)
242243
- Pierre-Yves LEBECQ (pylebecq)
243244
- Jordan Samouh (jordansamouh)
@@ -263,6 +264,8 @@ Symfony is the result of the work of many people who made the code better
263264
- Pavel Batanov (scaytrase)
264265
- Nikita Konstantinov
265266
- Wodor Wodorski
267+
- Rob Frawley 2nd (robfrawley)
268+
- Gregor Harlan (gharlan)
266269
- Thomas Lallement (raziel057)
267270
- Giorgio Premi
268271
- Matthieu Napoli (mnapoli)
@@ -278,7 +281,6 @@ Symfony is the result of the work of many people who made the code better
278281
- Marc Weistroff (futurecat)
279282
- Christian Schmidt
280283
- Hidde Wieringa (hiddewie)
281-
- Alessandro Chitolina
282284
- Chad Sikorra (chadsikorra)
283285
- Chris Smith (cs278)
284286
- Florian Klein (docteurklein)
@@ -315,7 +317,6 @@ Symfony is the result of the work of many people who made the code better
315317
- Thierry Thuon (lepiaf)
316318
- Ricard Clau (ricardclau)
317319
- Mark Challoner (markchalloner)
318-
- Gregor Harlan (gharlan)
319320
- Gennady Telegin (gtelegin)
320321
- Ben Davies (bendavies)
321322
- Erin Millard
@@ -324,7 +325,6 @@ Symfony is the result of the work of many people who made the code better
324325
- Magnus Nordlander (magnusnordlander)
325326
- alquerci
326327
- Francesco Levorato
327-
- Rob Frawley 2nd (robfrawley)
328328
- Vitaliy Zakharov (zakharovvi)
329329
- Tobias Sjösten (tobiassjosten)
330330
- Gyula Sallai (salla)
@@ -341,6 +341,7 @@ Symfony is the result of the work of many people who made the code better
341341
- Thomas Calvet (fancyweb)
342342
- Niels Keurentjes (curry684)
343343
- JhonnyL
344+
- David Badura (davidbadura)
344345
- hossein zolfi (ocean)
345346
- Clément Gautier (clementgautier)
346347
- Eduardo Gulias (egulias)
@@ -430,7 +431,6 @@ Symfony is the result of the work of many people who made the code better
430431
- Christian Wahler
431432
- Gintautas Miselis
432433
- Rob Bast
433-
- David Badura (davidbadura)
434434
- Zander Baldwin
435435
- Adam Harvey
436436
- Maxime Veber (nek-)
@@ -545,6 +545,7 @@ Symfony is the result of the work of many people who made the code better
545545
- Max Rath (drak3)
546546
- Stéphane Escandell (sescandell)
547547
- Konstantin S. M. Möllers (ksmmoellers)
548+
- James Johnston
548549
- Sinan Eldem
549550
- Alexandre Dupuy (satchette)
550551
- Andre Rømcke (andrerom)
@@ -593,6 +594,7 @@ Symfony is the result of the work of many people who made the code better
593594
- Ulumuddin Yunus (joenoez)
594595
- Luc Vieillescazes (iamluc)
595596
- Johann Saunier (prophet777)
597+
- Valentin Udaltsov (vudaltsov)
596598
- Michael Devery (mickadoo)
597599
- Antoine Corcy
598600
- Artur Eshenbrener
@@ -911,6 +913,7 @@ Symfony is the result of the work of many people who made the code better
911913
- Alex Demchenko (pilot)
912914
- Tadas Gliaubicas (tadcka)
913915
- Benoit Garret
916+
- Jakub Sacha
914917
- DerManoMann
915918
- Olaf Klischat
916919
- orlovv
@@ -1175,6 +1178,7 @@ Symfony is the result of the work of many people who made the code better
11751178
- Malte Wunsch
11761179
- wusuopu
11771180
- povilas
1181+
- Gavin Staniforth
11781182
- Alessandro Tagliapietra (alex88)
11791183
- Biji (biji)
11801184
- Gunnar Lium (gunnarlium)
@@ -1236,6 +1240,7 @@ Symfony is the result of the work of many people who made the code better
12361240
- flack
12371241
- izzyp
12381242
- František Bereň
1243+
- Mike Francis
12391244
- Christoph Nissle (derstoffel)
12401245
- Ionel Scutelnicu (ionelscutelnicu)
12411246
- Nicolas Tallefourtané (nicolab)
@@ -1246,6 +1251,7 @@ Symfony is the result of the work of many people who made the code better
12461251
- jjanvier
12471252
- Julius Beckmann
12481253
- Romain Dorgueil
1254+
- Christopher Parotat
12491255
- Grayson Koonce (breerly)
12501256
- Fabien LUCAS (flucas2)
12511257
- Indra Gunawan (indragunawan)
@@ -1537,11 +1543,13 @@ Symfony is the result of the work of many people who made the code better
15371543
- Ladislav Tánczos
15381544
- Brian Freytag
15391545
- Skorney
1546+
- fmarchalemisys
15401547
- mieszko4
15411548
- Steve Preston
15421549
- Neophy7e
15431550
- bokonet
15441551
- Arrilot
1552+
- Shaun Simmons
15451553
- Markus Staab
15461554
- Pierre-Louis LAUNAY
15471555
- djama
@@ -1570,6 +1578,7 @@ Symfony is the result of the work of many people who made the code better
15701578
- Penny Leach
15711579
- Richard Trebichavský
15721580
- g123456789l
1581+
- Jonathan Vollebregt
15731582
- oscartv
15741583
- DanSync
15751584
- Peter Zwosta
@@ -1682,7 +1691,6 @@ Symfony is the result of the work of many people who made the code better
16821691
- Moritz Kraft (userfriendly)
16831692
- Víctor Mateo (victormateo)
16841693
- Vincent (vincent1870)
1685-
- Valentin Udaltsov (vudaltsov)
16861694
- Eugene Babushkin (warl)
16871695
- Wouter Sioen (wouter_sioen)
16881696
- Xavier Amado (xamado)
@@ -1704,6 +1712,7 @@ Symfony is the result of the work of many people who made the code better
17041712
- Sergey Fedotov
17051713
- Michael
17061714
- fh-github@fholzhauer.de
1715+
- AbdElKader Bouadjadja
17071716
- Jan Emrich
17081717
- Mark Topper
17091718
- 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 <fabien@symfony.com>
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 <fabien@symfony.com>
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 <fabien@symfony.com>
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\Definition;
1918
use Symfony\Component\DependencyInjection\LazyProxy\PhpDumper\DumperInterface;

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public function testCreateProxyServiceWithRuntimeInstantiator()
3939
/* @var $foo1 \ProxyManager\Proxy\LazyLoadingInterface|\ProxyManager\Proxy\ValueHolderInterface */
4040
$foo1 = $builder->get('foo1');
4141

42+
$foo1->__destruct();
43+
$this->assertSame(0, $foo1::$destructorCount);
44+
4245
$this->assertSame($foo1, $builder->get('foo1'), 'The same proxy is retrieved on multiple subsequent calls');
4346
$this->assertInstanceOf('\ProxyManagerBridgeFooClass', $foo1);
4447
$this->assertInstanceOf('\ProxyManager\Proxy\LazyLoadingInterface', $foo1);
@@ -50,5 +53,8 @@ public function testCreateProxyServiceWithRuntimeInstantiator()
5053
$this->assertTrue($foo1->isProxyInitialized());
5154
$this->assertInstanceOf('\ProxyManagerBridgeFooClass', $foo1->getWrappedValueHolderValue());
5255
$this->assertNotInstanceOf('\ProxyManager\Proxy\LazyLoadingInterface', $foo1->getWrappedValueHolderValue());
56+
57+
$foo1->__destruct();
58+
$this->assertSame(1, $foo1::$destructorCount);
5359
}
5460
}

0 commit comments

Comments
 (0)
0