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
This commit is contained in:
commit
2807709fed
@ -7,6 +7,17 @@ in 2.7 minor versions.
|
|||||||
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
|
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
|
||||||
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.7.0...v2.7.1
|
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.7.0...v2.7.1
|
||||||
|
|
||||||
|
* 2.7.33 (2017-08-01)
|
||||||
|
|
||||||
|
* bug #22244 [Console] Fix passing options with defaultCommand (Jakub Sacha)
|
||||||
|
* bug #23684 [Debug] Missing escape in debug output (c960657)
|
||||||
|
* bug #23662 [VarDumper] Adapt to php 7.2 changes (nicolas-grekas)
|
||||||
|
* bug #23649 [Form][TwigBridge] Don't render _method in form_rest() for a child form (fmarchalemisys)
|
||||||
|
* bug #23619 [Validator] Fix IbanValidator for ukrainian IBANs (paroe)
|
||||||
|
* bug #23238 [Security] ensure the 'route' index is set before attempting to use it (gsdevme)
|
||||||
|
* bug #23580 Fix login redirect when referer contains a query string (fabpot)
|
||||||
|
* bug #23574 [VarDumper] Move locale sniffing to dump() time (nicolas-grekas)
|
||||||
|
|
||||||
* 2.7.32 (2017-07-17)
|
* 2.7.32 (2017-07-17)
|
||||||
|
|
||||||
* security #23507 [Security] validate empty passwords again (xabbuh)
|
* security #23507 [Security] validate empty passwords again (xabbuh)
|
||||||
|
@ -20,11 +20,11 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Javier Eguiluz (javier.eguiluz)
|
- Javier Eguiluz (javier.eguiluz)
|
||||||
- Hugo Hamon (hhamon)
|
- Hugo Hamon (hhamon)
|
||||||
- Maxime Steinhausser (ogizanagi)
|
- Maxime Steinhausser (ogizanagi)
|
||||||
- Abdellatif Ait boudad (aitboudad)
|
|
||||||
- Robin Chalas (chalas_r)
|
- Robin Chalas (chalas_r)
|
||||||
|
- Abdellatif Ait boudad (aitboudad)
|
||||||
|
- Grégoire Pineau (lyrixx)
|
||||||
- Romain Neutron (romain)
|
- Romain Neutron (romain)
|
||||||
- Pascal Borreli (pborreli)
|
- Pascal Borreli (pborreli)
|
||||||
- Grégoire Pineau (lyrixx)
|
|
||||||
- Wouter De Jong (wouterj)
|
- Wouter De Jong (wouterj)
|
||||||
- Joseph Bielawski (stloyd)
|
- Joseph Bielawski (stloyd)
|
||||||
- Karma Dordrak (drak)
|
- Karma Dordrak (drak)
|
||||||
@ -34,8 +34,8 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Jean-François Simon (jfsimon)
|
- Jean-François Simon (jfsimon)
|
||||||
- Benjamin Eberlei (beberlei)
|
- Benjamin Eberlei (beberlei)
|
||||||
- Igor Wiedler (igorw)
|
- Igor Wiedler (igorw)
|
||||||
- Eriksen Costa (eriksencosta)
|
|
||||||
- Roland Franssen (ro0)
|
- Roland Franssen (ro0)
|
||||||
|
- Eriksen Costa (eriksencosta)
|
||||||
- Jules Pietri (heah)
|
- Jules Pietri (heah)
|
||||||
- Sarah Khalil (saro0h)
|
- Sarah Khalil (saro0h)
|
||||||
- Guilhem Niot (energetick)
|
- Guilhem Niot (energetick)
|
||||||
@ -66,6 +66,7 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Eric Clemmons (ericclemmons)
|
- Eric Clemmons (ericclemmons)
|
||||||
- Charles Sarrazin (csarrazi)
|
- Charles Sarrazin (csarrazi)
|
||||||
- Christian Raue
|
- Christian Raue
|
||||||
|
- Konstantin Myakshin (koc)
|
||||||
- Arnout Boks (aboks)
|
- Arnout Boks (aboks)
|
||||||
- Deni
|
- Deni
|
||||||
- Henrik Westphal (snc)
|
- Henrik Westphal (snc)
|
||||||
@ -73,7 +74,7 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Jáchym Toušek (enumag)
|
- Jáchym Toušek (enumag)
|
||||||
- Titouan Galopin (tgalopin)
|
- Titouan Galopin (tgalopin)
|
||||||
- Douglas Greenshields (shieldo)
|
- Douglas Greenshields (shieldo)
|
||||||
- Konstantin Myakshin (koc)
|
- Dany Maillard (maidmaid)
|
||||||
- Lee McDermott
|
- Lee McDermott
|
||||||
- Brandon Turner
|
- Brandon Turner
|
||||||
- Luis Cordova (cordoval)
|
- Luis Cordova (cordoval)
|
||||||
@ -89,23 +90,22 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Fran Moreno (franmomu)
|
- Fran Moreno (franmomu)
|
||||||
- Antoine Hérault (herzult)
|
- Antoine Hérault (herzult)
|
||||||
- Paráda József (paradajozsef)
|
- Paráda József (paradajozsef)
|
||||||
|
- Issei Murasawa (issei_m)
|
||||||
- Arnaud Le Blanc (arnaud-lb)
|
- Arnaud Le Blanc (arnaud-lb)
|
||||||
- Maxime STEINHAUSSER
|
- Maxime STEINHAUSSER
|
||||||
- Alexander M. Turek (derrabus)
|
- Alexander M. Turek (derrabus)
|
||||||
- Michal Piotrowski (eventhorizon)
|
- Michal Piotrowski (eventhorizon)
|
||||||
- Dany Maillard (maidmaid)
|
|
||||||
- Issei Murasawa (issei_m)
|
|
||||||
- Tim Nagel (merk)
|
- Tim Nagel (merk)
|
||||||
|
- Yonel Ceruto González (yonelceruto)
|
||||||
- Brice BERNARD (brikou)
|
- Brice BERNARD (brikou)
|
||||||
- Baptiste Clavié (talus)
|
- Baptiste Clavié (talus)
|
||||||
- Vladimir Reznichenko (kalessil)
|
- Vladimir Reznichenko (kalessil)
|
||||||
- marc.weistroff
|
- marc.weistroff
|
||||||
- Yonel Ceruto González (yonelceruto)
|
|
||||||
- lenar
|
- lenar
|
||||||
|
- Tobias Nyholm (tobias)
|
||||||
- Włodzimierz Gajda (gajdaw)
|
- Włodzimierz Gajda (gajdaw)
|
||||||
- Alexander Schwenn (xelaris)
|
- Alexander Schwenn (xelaris)
|
||||||
- Jacob Dreesen (jdreesen)
|
- Jacob Dreesen (jdreesen)
|
||||||
- Tobias Nyholm (tobias)
|
|
||||||
- Florian Voutzinos (florianv)
|
- Florian Voutzinos (florianv)
|
||||||
- Colin Frei
|
- Colin Frei
|
||||||
- Adrien Brault (adrienbrault)
|
- Adrien Brault (adrienbrault)
|
||||||
@ -132,13 +132,13 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Daniel Gomes (danielcsgomes)
|
- Daniel Gomes (danielcsgomes)
|
||||||
- Hidenori Goto (hidenorigoto)
|
- Hidenori Goto (hidenorigoto)
|
||||||
- Guilherme Blanco (guilhermeblanco)
|
- Guilherme Blanco (guilhermeblanco)
|
||||||
|
- David Maicher (dmaicher)
|
||||||
- Pablo Godel (pgodel)
|
- Pablo Godel (pgodel)
|
||||||
- Jérémie Augustin (jaugustin)
|
- Jérémie Augustin (jaugustin)
|
||||||
- Andréia Bohner (andreia)
|
- Andréia Bohner (andreia)
|
||||||
- Rafael Dohms (rdohms)
|
- Rafael Dohms (rdohms)
|
||||||
- Arnaud Kleinpeter (nanocom)
|
- Arnaud Kleinpeter (nanocom)
|
||||||
- jwdeitch
|
- jwdeitch
|
||||||
- David Maicher (dmaicher)
|
|
||||||
- Mikael Pajunen
|
- Mikael Pajunen
|
||||||
- Joel Wurtz (brouznouf)
|
- Joel Wurtz (brouznouf)
|
||||||
- Jérôme Vasseur (jvasseur)
|
- Jérôme Vasseur (jvasseur)
|
||||||
@ -175,6 +175,7 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Dennis Benkert (denderello)
|
- Dennis Benkert (denderello)
|
||||||
- Benjamin Dulau (dbenjamin)
|
- Benjamin Dulau (dbenjamin)
|
||||||
- Mathieu Lemoine (lemoinem)
|
- Mathieu Lemoine (lemoinem)
|
||||||
|
- Christian Schmidt
|
||||||
- Andreas Hucks (meandmymonkey)
|
- Andreas Hucks (meandmymonkey)
|
||||||
- Noel Guilbert (noel)
|
- Noel Guilbert (noel)
|
||||||
- Stepan Anchugov (kix)
|
- Stepan Anchugov (kix)
|
||||||
@ -200,7 +201,6 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- John Kary (johnkary)
|
- John Kary (johnkary)
|
||||||
- Justin Hileman (bobthecow)
|
- Justin Hileman (bobthecow)
|
||||||
- Blanchon Vincent (blanchonvincent)
|
- Blanchon Vincent (blanchonvincent)
|
||||||
- Christian Schmidt
|
|
||||||
- Michele Orselli (orso)
|
- Michele Orselli (orso)
|
||||||
- Tom Van Looy (tvlooy)
|
- Tom Van Looy (tvlooy)
|
||||||
- Sven Paulus (subsven)
|
- Sven Paulus (subsven)
|
||||||
@ -236,6 +236,7 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Katsuhiro OGAWA
|
- Katsuhiro OGAWA
|
||||||
- Patrick McDougle (patrick-mcdougle)
|
- Patrick McDougle (patrick-mcdougle)
|
||||||
- Alif Rachmawadi
|
- Alif Rachmawadi
|
||||||
|
- Alessandro Chitolina
|
||||||
- Kristen Gilden (kgilden)
|
- Kristen Gilden (kgilden)
|
||||||
- Pierre-Yves LEBECQ (pylebecq)
|
- Pierre-Yves LEBECQ (pylebecq)
|
||||||
- Jordan Samouh (jordansamouh)
|
- Jordan Samouh (jordansamouh)
|
||||||
@ -261,6 +262,8 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Pavel Batanov (scaytrase)
|
- Pavel Batanov (scaytrase)
|
||||||
- Nikita Konstantinov
|
- Nikita Konstantinov
|
||||||
- Wodor Wodorski
|
- Wodor Wodorski
|
||||||
|
- Rob Frawley 2nd (robfrawley)
|
||||||
|
- Gregor Harlan (gharlan)
|
||||||
- Thomas Lallement (raziel057)
|
- Thomas Lallement (raziel057)
|
||||||
- Giorgio Premi
|
- Giorgio Premi
|
||||||
- Matthieu Napoli (mnapoli)
|
- Matthieu Napoli (mnapoli)
|
||||||
@ -276,7 +279,6 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Marc Weistroff (futurecat)
|
- Marc Weistroff (futurecat)
|
||||||
- Christian Schmidt
|
- Christian Schmidt
|
||||||
- Hidde Wieringa (hiddewie)
|
- Hidde Wieringa (hiddewie)
|
||||||
- Alessandro Chitolina
|
|
||||||
- Chad Sikorra (chadsikorra)
|
- Chad Sikorra (chadsikorra)
|
||||||
- Chris Smith (cs278)
|
- Chris Smith (cs278)
|
||||||
- Florian Klein (docteurklein)
|
- Florian Klein (docteurklein)
|
||||||
@ -313,7 +315,6 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Thierry Thuon (lepiaf)
|
- Thierry Thuon (lepiaf)
|
||||||
- Ricard Clau (ricardclau)
|
- Ricard Clau (ricardclau)
|
||||||
- Mark Challoner (markchalloner)
|
- Mark Challoner (markchalloner)
|
||||||
- Gregor Harlan (gharlan)
|
|
||||||
- Gennady Telegin (gtelegin)
|
- Gennady Telegin (gtelegin)
|
||||||
- Ben Davies (bendavies)
|
- Ben Davies (bendavies)
|
||||||
- Erin Millard
|
- Erin Millard
|
||||||
@ -322,7 +323,6 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Magnus Nordlander (magnusnordlander)
|
- Magnus Nordlander (magnusnordlander)
|
||||||
- alquerci
|
- alquerci
|
||||||
- Francesco Levorato
|
- Francesco Levorato
|
||||||
- Rob Frawley 2nd (robfrawley)
|
|
||||||
- Vitaliy Zakharov (zakharovvi)
|
- Vitaliy Zakharov (zakharovvi)
|
||||||
- Tobias Sjösten (tobiassjosten)
|
- Tobias Sjösten (tobiassjosten)
|
||||||
- Gyula Sallai (salla)
|
- Gyula Sallai (salla)
|
||||||
@ -339,6 +339,7 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Thomas Calvet (fancyweb)
|
- Thomas Calvet (fancyweb)
|
||||||
- Niels Keurentjes (curry684)
|
- Niels Keurentjes (curry684)
|
||||||
- JhonnyL
|
- JhonnyL
|
||||||
|
- David Badura (davidbadura)
|
||||||
- hossein zolfi (ocean)
|
- hossein zolfi (ocean)
|
||||||
- Clément Gautier (clementgautier)
|
- Clément Gautier (clementgautier)
|
||||||
- Eduardo Gulias (egulias)
|
- Eduardo Gulias (egulias)
|
||||||
@ -428,7 +429,6 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Christian Wahler
|
- Christian Wahler
|
||||||
- Gintautas Miselis
|
- Gintautas Miselis
|
||||||
- Rob Bast
|
- Rob Bast
|
||||||
- David Badura (davidbadura)
|
|
||||||
- Zander Baldwin
|
- Zander Baldwin
|
||||||
- Adam Harvey
|
- Adam Harvey
|
||||||
- Maxime Veber (nek-)
|
- Maxime Veber (nek-)
|
||||||
@ -543,6 +543,7 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Max Rath (drak3)
|
- Max Rath (drak3)
|
||||||
- Stéphane Escandell (sescandell)
|
- Stéphane Escandell (sescandell)
|
||||||
- Konstantin S. M. Möllers (ksmmoellers)
|
- Konstantin S. M. Möllers (ksmmoellers)
|
||||||
|
- James Johnston
|
||||||
- Sinan Eldem
|
- Sinan Eldem
|
||||||
- Alexandre Dupuy (satchette)
|
- Alexandre Dupuy (satchette)
|
||||||
- Andre Rømcke (andrerom)
|
- Andre Rømcke (andrerom)
|
||||||
@ -591,6 +592,7 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Ulumuddin Yunus (joenoez)
|
- Ulumuddin Yunus (joenoez)
|
||||||
- Luc Vieillescazes (iamluc)
|
- Luc Vieillescazes (iamluc)
|
||||||
- Johann Saunier (prophet777)
|
- Johann Saunier (prophet777)
|
||||||
|
- Valentin Udaltsov (vudaltsov)
|
||||||
- Michael Devery (mickadoo)
|
- Michael Devery (mickadoo)
|
||||||
- Antoine Corcy
|
- Antoine Corcy
|
||||||
- Artur Eshenbrener
|
- Artur Eshenbrener
|
||||||
@ -909,6 +911,7 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Alex Demchenko (pilot)
|
- Alex Demchenko (pilot)
|
||||||
- Tadas Gliaubicas (tadcka)
|
- Tadas Gliaubicas (tadcka)
|
||||||
- Benoit Garret
|
- Benoit Garret
|
||||||
|
- Jakub Sacha
|
||||||
- DerManoMann
|
- DerManoMann
|
||||||
- Olaf Klischat
|
- Olaf Klischat
|
||||||
- orlovv
|
- orlovv
|
||||||
@ -1173,6 +1176,7 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Malte Wunsch
|
- Malte Wunsch
|
||||||
- wusuopu
|
- wusuopu
|
||||||
- povilas
|
- povilas
|
||||||
|
- Gavin Staniforth
|
||||||
- Alessandro Tagliapietra (alex88)
|
- Alessandro Tagliapietra (alex88)
|
||||||
- Biji (biji)
|
- Biji (biji)
|
||||||
- Gunnar Lium (gunnarlium)
|
- Gunnar Lium (gunnarlium)
|
||||||
@ -1234,6 +1238,7 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- flack
|
- flack
|
||||||
- izzyp
|
- izzyp
|
||||||
- František Bereň
|
- František Bereň
|
||||||
|
- Mike Francis
|
||||||
- Christoph Nissle (derstoffel)
|
- Christoph Nissle (derstoffel)
|
||||||
- Ionel Scutelnicu (ionelscutelnicu)
|
- Ionel Scutelnicu (ionelscutelnicu)
|
||||||
- Nicolas Tallefourtané (nicolab)
|
- Nicolas Tallefourtané (nicolab)
|
||||||
@ -1244,6 +1249,7 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- jjanvier
|
- jjanvier
|
||||||
- Julius Beckmann
|
- Julius Beckmann
|
||||||
- Romain Dorgueil
|
- Romain Dorgueil
|
||||||
|
- Christopher Parotat
|
||||||
- Grayson Koonce (breerly)
|
- Grayson Koonce (breerly)
|
||||||
- Fabien LUCAS (flucas2)
|
- Fabien LUCAS (flucas2)
|
||||||
- Indra Gunawan (indragunawan)
|
- Indra Gunawan (indragunawan)
|
||||||
@ -1535,11 +1541,13 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Ladislav Tánczos
|
- Ladislav Tánczos
|
||||||
- Brian Freytag
|
- Brian Freytag
|
||||||
- Skorney
|
- Skorney
|
||||||
|
- fmarchalemisys
|
||||||
- mieszko4
|
- mieszko4
|
||||||
- Steve Preston
|
- Steve Preston
|
||||||
- Neophy7e
|
- Neophy7e
|
||||||
- bokonet
|
- bokonet
|
||||||
- Arrilot
|
- Arrilot
|
||||||
|
- Shaun Simmons
|
||||||
- Markus Staab
|
- Markus Staab
|
||||||
- Pierre-Louis LAUNAY
|
- Pierre-Louis LAUNAY
|
||||||
- djama
|
- djama
|
||||||
@ -1568,6 +1576,7 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Penny Leach
|
- Penny Leach
|
||||||
- Richard Trebichavský
|
- Richard Trebichavský
|
||||||
- g123456789l
|
- g123456789l
|
||||||
|
- Jonathan Vollebregt
|
||||||
- oscartv
|
- oscartv
|
||||||
- DanSync
|
- DanSync
|
||||||
- Peter Zwosta
|
- Peter Zwosta
|
||||||
@ -1680,7 +1689,6 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Moritz Kraft (userfriendly)
|
- Moritz Kraft (userfriendly)
|
||||||
- Víctor Mateo (victormateo)
|
- Víctor Mateo (victormateo)
|
||||||
- Vincent (vincent1870)
|
- Vincent (vincent1870)
|
||||||
- Valentin Udaltsov (vudaltsov)
|
|
||||||
- Eugene Babushkin (warl)
|
- Eugene Babushkin (warl)
|
||||||
- Wouter Sioen (wouter_sioen)
|
- Wouter Sioen (wouter_sioen)
|
||||||
- Xavier Amado (xamado)
|
- Xavier Amado (xamado)
|
||||||
@ -1702,6 +1710,7 @@ Symfony is the result of the work of many people who made the code better
|
|||||||
- Sergey Fedotov
|
- Sergey Fedotov
|
||||||
- Michael
|
- Michael
|
||||||
- fh-github@fholzhauer.de
|
- fh-github@fholzhauer.de
|
||||||
|
- AbdElKader Bouadjadja
|
||||||
- Jan Emrich
|
- Jan Emrich
|
||||||
- Mark Topper
|
- Mark Topper
|
||||||
- Xavier REN
|
- Xavier REN
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Bridge\ProxyManager\LazyProxy\Instantiator;
|
||||||
|
|
||||||
|
use ProxyManager\Factory\LazyLoadingValueHolderFactory as BaseFactory;
|
||||||
|
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\LazyLoadingValueHolderGenerator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class LazyLoadingValueHolderFactoryV1 extends BaseFactory
|
||||||
|
{
|
||||||
|
private $generatorV1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function getGenerator()
|
||||||
|
{
|
||||||
|
return $this->generatorV1 ?: $this->generatorV1 = new LazyLoadingValueHolderGenerator();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Bridge\ProxyManager\LazyProxy\Instantiator;
|
||||||
|
|
||||||
|
use ProxyManager\ProxyGenerator\ProxyGeneratorInterface;
|
||||||
|
use ProxyManager\Factory\LazyLoadingValueHolderFactory as BaseFactory;
|
||||||
|
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\LazyLoadingValueHolderGenerator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class LazyLoadingValueHolderFactoryV2 extends BaseFactory
|
||||||
|
{
|
||||||
|
private $generator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function getGenerator(): ProxyGeneratorInterface
|
||||||
|
{
|
||||||
|
return $this->generator ?: $this->generator = new LazyLoadingValueHolderGenerator();
|
||||||
|
}
|
||||||
|
}
|
@ -36,7 +36,11 @@ class RuntimeInstantiator implements InstantiatorInterface
|
|||||||
$config = new Configuration();
|
$config = new Configuration();
|
||||||
$config->setGeneratorStrategy(new EvaluatingGeneratorStrategy());
|
$config->setGeneratorStrategy(new EvaluatingGeneratorStrategy());
|
||||||
|
|
||||||
$this->factory = new LazyLoadingValueHolderFactory($config);
|
if (method_exists('ProxyManager\Version', 'getVersion')) {
|
||||||
|
$this->factory = new LazyLoadingValueHolderFactoryV2($config);
|
||||||
|
} else {
|
||||||
|
$this->factory = new LazyLoadingValueHolderFactoryV1($config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper;
|
||||||
|
|
||||||
|
use ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerator as BaseGenerator;
|
||||||
|
use Zend\Code\Generator\ClassGenerator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class LazyLoadingValueHolderGenerator extends BaseGenerator
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function generate(\ReflectionClass $originalClass, ClassGenerator $classGenerator)
|
||||||
|
{
|
||||||
|
parent::generate($originalClass, $classGenerator);
|
||||||
|
|
||||||
|
if ($classGenerator->hasMethod('__destruct')) {
|
||||||
|
$destructor = $classGenerator->getMethod('__destruct');
|
||||||
|
$body = $destructor->getBody();
|
||||||
|
$newBody = preg_replace('/^(\$this->initializer[a-zA-Z0-9]++) && .*;\n\nreturn (\$this->valueHolder)/', '$1 || $2', $body);
|
||||||
|
|
||||||
|
if ($body === $newBody) {
|
||||||
|
throw new \UnexpectedValueException(sprintf('Unexpected lazy-proxy format generated for method %s::__destruct()', $originalClass->name));
|
||||||
|
}
|
||||||
|
|
||||||
|
$destructor->setBody($newBody);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -13,7 +13,6 @@ namespace Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper;
|
|||||||
|
|
||||||
use ProxyManager\Generator\ClassGenerator;
|
use ProxyManager\Generator\ClassGenerator;
|
||||||
use ProxyManager\GeneratorStrategy\BaseGeneratorStrategy;
|
use ProxyManager\GeneratorStrategy\BaseGeneratorStrategy;
|
||||||
use ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerator;
|
|
||||||
use Symfony\Component\DependencyInjection\Container;
|
use Symfony\Component\DependencyInjection\Container;
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Component\DependencyInjection\Definition;
|
use Symfony\Component\DependencyInjection\Definition;
|
||||||
|
@ -39,6 +39,9 @@ class ContainerBuilderTest extends TestCase
|
|||||||
/* @var $foo1 \ProxyManager\Proxy\LazyLoadingInterface|\ProxyManager\Proxy\ValueHolderInterface */
|
/* @var $foo1 \ProxyManager\Proxy\LazyLoadingInterface|\ProxyManager\Proxy\ValueHolderInterface */
|
||||||
$foo1 = $builder->get('foo1');
|
$foo1 = $builder->get('foo1');
|
||||||
|
|
||||||
|
$foo1->__destruct();
|
||||||
|
$this->assertSame(0, $foo1::$destructorCount);
|
||||||
|
|
||||||
$this->assertSame($foo1, $builder->get('foo1'), 'The same proxy is retrieved on multiple subsequent calls');
|
$this->assertSame($foo1, $builder->get('foo1'), 'The same proxy is retrieved on multiple subsequent calls');
|
||||||
$this->assertInstanceOf('\ProxyManagerBridgeFooClass', $foo1);
|
$this->assertInstanceOf('\ProxyManagerBridgeFooClass', $foo1);
|
||||||
$this->assertInstanceOf('\ProxyManager\Proxy\LazyLoadingInterface', $foo1);
|
$this->assertInstanceOf('\ProxyManager\Proxy\LazyLoadingInterface', $foo1);
|
||||||
@ -50,5 +53,8 @@ class ContainerBuilderTest extends TestCase
|
|||||||
$this->assertTrue($foo1->isProxyInitialized());
|
$this->assertTrue($foo1->isProxyInitialized());
|
||||||
$this->assertInstanceOf('\ProxyManagerBridgeFooClass', $foo1->getWrappedValueHolderValue());
|
$this->assertInstanceOf('\ProxyManagerBridgeFooClass', $foo1->getWrappedValueHolderValue());
|
||||||
$this->assertNotInstanceOf('\ProxyManager\Proxy\LazyLoadingInterface', $foo1->getWrappedValueHolderValue());
|
$this->assertNotInstanceOf('\ProxyManager\Proxy\LazyLoadingInterface', $foo1->getWrappedValueHolderValue());
|
||||||
|
|
||||||
|
$foo1->__destruct();
|
||||||
|
$this->assertSame(1, $foo1::$destructorCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
class ProxyManagerBridgeFooClass
|
class ProxyManagerBridgeFooClass
|
||||||
{
|
{
|
||||||
|
public static $destructorCount = 0;
|
||||||
|
|
||||||
public $foo;
|
public $foo;
|
||||||
public $moo;
|
public $moo;
|
||||||
|
|
||||||
@ -38,4 +40,9 @@ class ProxyManagerBridgeFooClass
|
|||||||
{
|
{
|
||||||
$this->bar = $value;
|
$this->bar = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function __destruct()
|
||||||
|
{
|
||||||
|
++self::$destructorCount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user