Merge branch '4.1'

* 4.1:
  [VarDumper] fix dump of closures created from callables
  [DI] fix dumping inlined services
  Add framework asset changes to upgrade 3.0 guide
  [Travis] Bump ext-mongodb to 1.5.2 on Travis
  [DI] dont track classes/interfaces used to compute autowiring error messages
  [DI] fix GraphvizDumper ignoring inline definitions
  bumped Symfony version to 4.1.8
  updated VERSION for 4.1.7
  updated CHANGELOG for 4.1.7
  bumped Symfony version to 3.4.19
  updated VERSION for 3.4.18
  updated CHANGELOG for 3.4.18
  bumped Symfony version to 2.8.48
  updated VERSION for 2.8.47
  update CONTRIBUTORS for 2.8.47
  updated CHANGELOG for 2.8.47
  Fix ini_get() for boolean values
This commit is contained in:
Nicolas Grekas 2018-11-06 18:10:56 +01:00
commit 8d277ce3e5
50 changed files with 519 additions and 186 deletions

View File

@ -162,7 +162,7 @@ before_install:
fi fi
tfold ext.apcu tpecl apcu-5.1.6 apcu.so $INI tfold ext.apcu tpecl apcu-5.1.6 apcu.so $INI
tfold ext.mongodb tpecl mongodb-1.5.0 mongodb.so $INI tfold ext.mongodb tpecl mongodb-1.5.2 mongodb.so $INI
tfold ext.amqp tpecl amqp-1.9.3 amqp.so $INI tfold ext.amqp tpecl amqp-1.9.3 amqp.so $INI
tfold ext.igbinary tpecl igbinary-2.0.6 igbinary.so $INI tfold ext.igbinary tpecl igbinary-2.0.6 igbinary.so $INI
tfold ext.zookeeper tpecl zookeeper-0.5.0 zookeeper.so $INI tfold ext.zookeeper tpecl zookeeper-0.5.0 zookeeper.so $INI
@ -227,7 +227,7 @@ install:
break break
fi fi
phpenv global $PHP phpenv global $PHP
([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer require --dev --no-update mongodb/mongodb) ([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.5.2; composer require --dev --no-update mongodb/mongodb)
tfold 'composer update' $COMPOSER_UP tfold 'composer update' $COMPOSER_UP
tfold 'phpunit install' ./phpunit install tfold 'phpunit install' ./phpunit install
if [[ $deps = high ]]; then if [[ $deps = high ]]; then

View File

@ -7,6 +7,32 @@ in 4.1 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/v4.1.0...v4.1.1 To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.1.0...v4.1.1
* 4.1.7 (2018-11-03)
* bug #28820 [DependencyInjection] Fix tags on multiple decorated service (Soner Sayakci)
* bug #29020 Fix ini_get() for boolean values (deguif)
* bug #28955 [Messenger] send using the routing_key for AMQP transport (nicolas-grekas)
* bug #28960 also clean away the NO_AUTO_CACHE_CONTROL_HEADER if we have no session (dbu)
* feature #28893 [TwigBundle] Fix usage of TwigBundle without FrameworkBundle (tgalopin)
* bug #28889 [Serializer] Reduce class discriminator overhead (fbourigault)
* bug #28861 [DependencyInjection] Skip empty proxy code (olvlvl)
* bug #28801 Convert InsufficientAuthenticationException to HttpException with 401 status code (vincentchalamon)
* bug #28840 add missing double-quotes to extra_fields output message (danielkay)
* bug #28838 [DI] Default undefined env to empty string during compile (ro0NL)
* bug #28863 [Process] Allow to pass non-string arguments to Process (vudaltsov)
* bug #28712 [Form] reverse transform RFC 3339 formatted dates (xabbuh)
* bug #28813 Fix for race condition in console output stream write (rudolfratusinski)
* bug #27772 [Console] Fixes multiselect choice question defaults in non-interactive mode (veewee)
* bug #28835 [FrameworkBundle] Setting missing default paths under BC layer (yceruto)
* bug #28760 [DI] fix dumping inline services again (nicolas-grekas)
* bug #28689 [Process] fix locking of pipe files on Windows (nicolas-grekas)
* bug #28704 [Form] fix multi-digit seconds fraction handling (xabbuh)
* bug #28793 [SecurityBundle] do not override custom access decision configs (xabbuh)
* bug #28783 [FrameworkBundle] add missing cache prefix seed attribute to XSD (xabbuh)
* bug #28072 [Security] Do not deauthenticate user when the first refreshed user has changed (gpekz)
* bug #28735 [FWBundle] Automatically enable PropertyInfo when using Flex (dunglas)
* bug #28751 [FrameworkBundle] Register messenger before the profiler (sroze)
* 4.1.6 (2018-10-03) * 4.1.6 (2018-10-03)
* bug #28604 [Finder] fixed root directory access for ftp/sftp wrapper (DerDu) * bug #28604 [Finder] fixed root directory access for ftp/sftp wrapper (DerDu)

View File

@ -14,23 +14,23 @@ Symfony is the result of the work of many people who made the code better
- Victor Berchet (victor) - Victor Berchet (victor)
- Robin Chalas (chalas_r) - Robin Chalas (chalas_r)
- Kévin Dunglas (dunglas) - Kévin Dunglas (dunglas)
- Johannes S (johannes)
- Jakub Zalas (jakubzalas) - Jakub Zalas (jakubzalas)
- Johannes S (johannes)
- Maxime Steinhausser (ogizanagi) - Maxime Steinhausser (ogizanagi)
- Kris Wallsmith (kriswallsmith) - Kris Wallsmith (kriswallsmith)
- Ryan Weaver (weaverryan) - Ryan Weaver (weaverryan)
- Javier Eguiluz (javier.eguiluz) - Javier Eguiluz (javier.eguiluz)
- Grégoire Pineau (lyrixx) - Grégoire Pineau (lyrixx)
- Hugo Hamon (hhamon) - Hugo Hamon (hhamon)
- Abdellatif Ait boudad (aitboudad)
- Roland Franssen (ro0) - Roland Franssen (ro0)
- Abdellatif Ait boudad (aitboudad)
- Romain Neutron (romain) - Romain Neutron (romain)
- Pascal Borreli (pborreli) - Pascal Borreli (pborreli)
- Wouter De Jong (wouterj) - Wouter De Jong (wouterj)
- Joseph Bielawski (stloyd) - Joseph Bielawski (stloyd)
- Karma Dordrak (drak) - Karma Dordrak (drak)
- Lukas Kahwe Smith (lsmith)
- Samuel ROZE (sroze) - Samuel ROZE (sroze)
- Lukas Kahwe Smith (lsmith)
- Martin Hasoň (hason) - Martin Hasoň (hason)
- Jeremy Mikola (jmikola) - Jeremy Mikola (jmikola)
- Jean-François Simon (jfsimon) - Jean-François Simon (jfsimon)
@ -43,9 +43,9 @@ Symfony is the result of the work of many people who made the code better
- Sarah Khalil (saro0h) - Sarah Khalil (saro0h)
- Jonathan Wage (jwage) - Jonathan Wage (jwage)
- Hamza Amrouche (simperfit) - Hamza Amrouche (simperfit)
- Tobias Nyholm (tobias)
- Diego Saint Esteben (dosten) - Diego Saint Esteben (dosten)
- Iltar van der Berg (kjarli) - Iltar van der Berg (kjarli)
- Tobias Nyholm (tobias)
- Alexandre Salomé (alexandresalome) - Alexandre Salomé (alexandresalome)
- William Durand (couac) - William Durand (couac)
- ornicar - ornicar
@ -72,11 +72,12 @@ Symfony is the result of the work of many people who made the code better
- Titouan Galopin (tgalopin) - Titouan Galopin (tgalopin)
- Michel Weimerskirch (mweimerskirch) - Michel Weimerskirch (mweimerskirch)
- Andrej Hudec (pulzarraider) - Andrej Hudec (pulzarraider)
- Konstantin Myakshin (koc)
- Eric Clemmons (ericclemmons) - Eric Clemmons (ericclemmons)
- Jáchym Toušek (enumag) - Jáchym Toušek (enumag)
- Charles Sarrazin (csarrazi) - Charles Sarrazin (csarrazi)
- David Maicher (dmaicher) - David Maicher (dmaicher)
- Konstantin Myakshin (koc) - Vladimir Reznichenko (kalessil)
- Christian Raue - Christian Raue
- Issei Murasawa (issei_m) - Issei Murasawa (issei_m)
- Arnout Boks (aboks) - Arnout Boks (aboks)
@ -84,13 +85,12 @@ Symfony is the result of the work of many people who made the code better
- Henrik Westphal (snc) - Henrik Westphal (snc)
- Dariusz Górecki (canni) - Dariusz Górecki (canni)
- Douglas Greenshields (shieldo) - Douglas Greenshields (shieldo)
- Vladimir Reznichenko (kalessil) - Dariusz Ruminski
- Lee McDermott - Lee McDermott
- Brandon Turner - Brandon Turner
- Luis Cordova (cordoval) - Luis Cordova (cordoval)
- Graham Campbell (graham) - Graham Campbell (graham)
- Daniel Holmes (dholmes) - Daniel Holmes (dholmes)
- Dariusz Ruminski
- Toni Uebernickel (havvg) - Toni Uebernickel (havvg)
- Grégoire Paris (greg0ire) - Grégoire Paris (greg0ire)
- Bart van den Burg (burgov) - Bart van den Burg (burgov)
@ -98,6 +98,7 @@ Symfony is the result of the work of many people who made the code better
- Jérôme Tamarelle (gromnan) - Jérôme Tamarelle (gromnan)
- John Wards (johnwards) - John Wards (johnwards)
- Fran Moreno (franmomu) - Fran Moreno (franmomu)
- Valentin Udaltsov (vudaltsov)
- Antoine Hérault (herzult) - Antoine Hérault (herzult)
- Paráda József (paradajozsef) - Paráda József (paradajozsef)
- Arnaud Le Blanc (arnaud-lb) - Arnaud Le Blanc (arnaud-lb)
@ -106,9 +107,9 @@ Symfony is the result of the work of many people who made the code better
- gadelat (gadelat) - gadelat (gadelat)
- Tim Nagel (merk) - Tim Nagel (merk)
- Brice BERNARD (brikou) - Brice BERNARD (brikou)
- Valentin Udaltsov (vudaltsov)
- Baptiste Clavié (talus) - Baptiste Clavié (talus)
- marc.weistroff - marc.weistroff
- David Buchmann (dbu)
- lenar - lenar
- Alexander Schwenn (xelaris) - Alexander Schwenn (xelaris)
- Włodzimierz Gajda (gajdaw) - Włodzimierz Gajda (gajdaw)
@ -119,12 +120,12 @@ Symfony is the result of the work of many people who made the code better
- Adrien Brault (adrienbrault) - Adrien Brault (adrienbrault)
- Tomáš Votruba (tomas_votruba) - Tomáš Votruba (tomas_votruba)
- Joshua Thijssen - Joshua Thijssen
- David Buchmann (dbu)
- excelwebzone - excelwebzone
- Gordon Franke (gimler) - Gordon Franke (gimler)
- Fabien Pennequin (fabienpennequin) - Fabien Pennequin (fabienpennequin)
- Eric GELOEN (gelo) - Eric GELOEN (gelo)
- Sebastiaan Stok (sstok) - Sebastiaan Stok (sstok)
- Jérôme Vasseur (jvasseur)
- Lars Strojny (lstrojny) - Lars Strojny (lstrojny)
- Daniel Wehner (dawehner) - Daniel Wehner (dawehner)
- Tugdual Saunier (tucksaun) - Tugdual Saunier (tucksaun)
@ -134,7 +135,6 @@ Symfony is the result of the work of many people who made the code better
- Florian Lonqueu-Brochard (florianlb) - Florian Lonqueu-Brochard (florianlb)
- Chris Wilkinson (thewilkybarkid) - Chris Wilkinson (thewilkybarkid)
- Stefano Sala (stefano.sala) - Stefano Sala (stefano.sala)
- Jérôme Vasseur (jvasseur)
- Evgeniy (ewgraf) - Evgeniy (ewgraf)
- Alex Pott - Alex Pott
- Vincent AUBERT (vincent) - Vincent AUBERT (vincent)
@ -142,6 +142,7 @@ Symfony is the result of the work of many people who made the code better
- Tigran Azatyan (tigranazatyan) - Tigran Azatyan (tigranazatyan)
- Sebastian Hörl (blogsh) - Sebastian Hörl (blogsh)
- Daniel Gomes (danielcsgomes) - Daniel Gomes (danielcsgomes)
- Gabriel Caruso
- Hidenori Goto (hidenorigoto) - Hidenori Goto (hidenorigoto)
- Arnaud Kleinpeter (nanocom) - Arnaud Kleinpeter (nanocom)
- Jannik Zschiesche (apfelbox) - Jannik Zschiesche (apfelbox)
@ -165,6 +166,7 @@ Symfony is the result of the work of many people who made the code better
- Clemens Tolboom - Clemens Tolboom
- Helmer Aaviksoo - Helmer Aaviksoo
- Hiromi Hishida (77web) - Hiromi Hishida (77web)
- Niels Keurentjes (curry684)
- Matthieu Ouellette-Vachon (maoueh) - Matthieu Ouellette-Vachon (maoueh)
- Michał Pipa (michal.pipa) - Michał Pipa (michal.pipa)
- Dawid Nowak - Dawid Nowak
@ -177,16 +179,16 @@ Symfony is the result of the work of many people who made the code better
- jeremyFreeAgent (Jérémy Romey) (jeremyfreeagent) - jeremyFreeAgent (Jérémy Romey) (jeremyfreeagent)
- James Halsall (jaitsu) - James Halsall (jaitsu)
- Matthieu Napoli (mnapoli) - Matthieu Napoli (mnapoli)
- Gabriel Caruso
- Warnar Boekkooi (boekkooi) - Warnar Boekkooi (boekkooi)
- Alessandro Chitolina (alekitto)
- Dmitrii Chekaliuk (lazyhammer) - Dmitrii Chekaliuk (lazyhammer)
- Clément JOBEILI (dator) - Clément JOBEILI (dator)
- Niels Keurentjes (curry684)
- Daniel Espendiller - Daniel Espendiller
- Possum - Possum
- Dorian Villet (gnutix) - Dorian Villet (gnutix)
- Sergey Linnik (linniksa) - Sergey Linnik (linniksa)
- Richard Miller (mr_r_miller) - Richard Miller (mr_r_miller)
- Albert Casademont (acasademont)
- Mario A. Alvarez Garcia (nomack84) - Mario A. Alvarez Garcia (nomack84)
- Dennis Benkert (denderello) - Dennis Benkert (denderello)
- DQNEO - DQNEO
@ -204,6 +206,7 @@ Symfony is the result of the work of many people who made the code better
- sun (sun) - sun (sun)
- Larry Garfield (crell) - Larry Garfield (crell)
- Michaël Perrin (michael.perrin) - Michaël Perrin (michael.perrin)
- Nikolay Labinskiy (e-moe)
- Martin Schuhfuß (usefulthink) - Martin Schuhfuß (usefulthink)
- apetitpa - apetitpa
- Matthieu Bontemps (mbontemps) - Matthieu Bontemps (mbontemps)
@ -225,15 +228,12 @@ Symfony is the result of the work of many people who made the code better
- Tom Van Looy (tvlooy) - Tom Van Looy (tvlooy)
- Sven Paulus (subsven) - Sven Paulus (subsven)
- Rui Marinho (ruimarinho) - Rui Marinho (ruimarinho)
- Alessandro Chitolina
- Eugene Wissner - Eugene Wissner
- Pascal Montoya - Pascal Montoya
- Julien Brochet (mewt) - Julien Brochet (mewt)
- Leo Feyer - Leo Feyer
- Tristan Darricau (nicofuma) - Tristan Darricau (nicofuma)
- Nikolay Labinskiy (e-moe)
- Marcel Beerta (mazen) - Marcel Beerta (mazen)
- Albert Casademont (acasademont)
- Pavel Batanov (scaytrase) - Pavel Batanov (scaytrase)
- Loïc Faugeron - Loïc Faugeron
- Hidde Wieringa (hiddewie) - Hidde Wieringa (hiddewie)
@ -248,6 +248,7 @@ Symfony is the result of the work of many people who made the code better
- Francois Zaninotto - Francois Zaninotto
- Alexander Kotynia (olden) - Alexander Kotynia (olden)
- Daniel Tschinder - Daniel Tschinder
- Christian Schmidt
- Marcos Sánchez - Marcos Sánchez
- Elnur Abdurrakhimov (elnur) - Elnur Abdurrakhimov (elnur)
- Manuel Reinhard (sprain) - Manuel Reinhard (sprain)
@ -258,6 +259,7 @@ Symfony is the result of the work of many people who made the code better
- Roman Marintšenko (inori) - Roman Marintšenko (inori)
- Xavier Montaña Carreras (xmontana) - Xavier Montaña Carreras (xmontana)
- Mickaël Andrieu (mickaelandrieu) - Mickaël Andrieu (mickaelandrieu)
- Maxime Veber (nek-)
- Xavier Perez - Xavier Perez
- Arjen Brouwer (arjenjb) - Arjen Brouwer (arjenjb)
- Katsuhiro OGAWA - Katsuhiro OGAWA
@ -291,8 +293,8 @@ Symfony is the result of the work of many people who made the code better
- Wodor Wodorski - Wodor Wodorski
- Thomas Lallement (raziel057) - Thomas Lallement (raziel057)
- mcfedr (mcfedr) - mcfedr (mcfedr)
- Colin O'Dell (colinodell)
- Giorgio Premi - Giorgio Premi
- Christian Schmidt
- Beau Simensen (simensen) - Beau Simensen (simensen)
- Michael Hirschler (mvhirsch) - Michael Hirschler (mvhirsch)
- Robert Kiss (kepten) - Robert Kiss (kepten)
@ -303,10 +305,10 @@ Symfony is the result of the work of many people who made the code better
- Jérôme Parmentier (lctrs) - Jérôme Parmentier (lctrs)
- Michael Babker (mbabker) - Michael Babker (mbabker)
- Peter Kruithof (pkruithof) - Peter Kruithof (pkruithof)
- François-Xavier de Guillebon (de-gui_f)
- Michael Holm (hollo) - Michael Holm (hollo)
- Marc Weistroff (futurecat) - Marc Weistroff (futurecat)
- Christian Schmidt - Christian Schmidt
- Maxime Veber (nek-)
- MatTheCat - MatTheCat
- Chad Sikorra (chadsikorra) - Chad Sikorra (chadsikorra)
- Chris Smith (cs278) - Chris Smith (cs278)
@ -317,6 +319,7 @@ Symfony is the result of the work of many people who made the code better
- rudy onfroy (ronfroy) - rudy onfroy (ronfroy)
- Andrew Moore (finewolf) - Andrew Moore (finewolf)
- Bertrand Zuchuat (garfield-fr) - Bertrand Zuchuat (garfield-fr)
- Sullivan SENECHAL (soullivaneuh)
- Gabor Toth (tgabi333) - Gabor Toth (tgabi333)
- realmfoo - realmfoo
- Thomas Tourlourat (armetiz) - Thomas Tourlourat (armetiz)
@ -346,8 +349,9 @@ 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)
- Colin O'Dell (colinodell)
- Gennady Telegin (gtelegin) - Gennady Telegin (gtelegin)
- Jan Schädlich (jschaedl)
- Fabien Bourigault (fbourigault)
- Ben Davies (bendavies) - Ben Davies (bendavies)
- Erin Millard - Erin Millard
- Artur Melo (restless) - Artur Melo (restless)
@ -363,7 +367,6 @@ Symfony is the result of the work of many people who made the code better
- Christian Gärtner (dagardner) - Christian Gärtner (dagardner)
- Tomasz Kowalczyk (thunderer) - Tomasz Kowalczyk (thunderer)
- Artur Eshenbrener - Artur Eshenbrener
- François-Xavier de Guillebon (de-gui_f)
- Damien Alexandre (damienalexandre) - Damien Alexandre (damienalexandre)
- Thomas Perez (scullwm) - Thomas Perez (scullwm)
- Felix Labrecque - Felix Labrecque
@ -384,7 +387,6 @@ Symfony is the result of the work of many people who made the code better
- Grzegorz (Greg) Zdanowski (kiler129) - Grzegorz (Greg) Zdanowski (kiler129)
- Kirill chEbba Chebunin (chebba) - Kirill chEbba Chebunin (chebba)
- Greg Thornton (xdissent) - Greg Thornton (xdissent)
- Sullivan SENECHAL (soullivaneuh)
- Costin Bereveanu (schniper) - Costin Bereveanu (schniper)
- Loïc Chardonnet (gnusat) - Loïc Chardonnet (gnusat)
- Marek Kalnik (marekkalnik) - Marek Kalnik (marekkalnik)
@ -393,16 +395,19 @@ Symfony is the result of the work of many people who made the code better
- Tamas Szijarto - Tamas Szijarto
- Michele Locati - Michele Locati
- Pavel Volokitin (pvolok) - Pavel Volokitin (pvolok)
- Smaine Milianni (ismail1432)
- Arthur de Moulins (4rthem) - Arthur de Moulins (4rthem)
- Nicolas Dewez (nicolas_dewez) - Nicolas Dewez (nicolas_dewez)
- Endre Fejes - Endre Fejes
- Tobias Naumann (tna) - Tobias Naumann (tna)
- George Mponos (gmponos)
- Daniel Beyer - Daniel Beyer
- Shein Alexey - Shein Alexey
- Alex Rock Ancelet (pierstoval) - Alex Rock Ancelet (pierstoval)
- Romain Gautier (mykiwi) - Romain Gautier (mykiwi)
- Joe Lencioni - Joe Lencioni
- Daniel Tschinder - Daniel Tschinder
- vladimir.reznichenko
- Kai - Kai
- Lee Rowlands - Lee Rowlands
- Krzysztof Piasecki (krzysztek) - Krzysztof Piasecki (krzysztek)
@ -437,13 +442,13 @@ Symfony is the result of the work of many people who made the code better
- Jan Schumann - Jan Schumann
- Niklas Fiekas - Niklas Fiekas
- Markus Bachmann (baachi) - Markus Bachmann (baachi)
- Jan Schädlich
- lancergr - lancergr
- Zan Baldwin - Zan Baldwin
- Mihai Stancu - Mihai Stancu
- Olivier Dolbeau (odolbeau) - Olivier Dolbeau (odolbeau)
- Jan Rosier (rosier) - Jan Rosier (rosier)
- Alessandro Lai (jean85) - Alessandro Lai (jean85)
- Pascal Luna (skalpa)
- Arturs Vonda - Arturs Vonda
- Josip Kruslin - Josip Kruslin
- Asmir Mustafic (goetas) - Asmir Mustafic (goetas)
@ -457,6 +462,7 @@ Symfony is the result of the work of many people who made the code better
- Chris Sedlmayr (catchamonkey) - Chris Sedlmayr (catchamonkey)
- Mateusz Sip (mateusz_sip) - Mateusz Sip (mateusz_sip)
- Remon van de Kamp - Remon van de Kamp
- Kamil Kokot (pamil)
- Seb Koelen - Seb Koelen
- Christoph Mewes (xrstf) - Christoph Mewes (xrstf)
- Vitaliy Tverdokhlib (vitaliytv) - Vitaliy Tverdokhlib (vitaliytv)
@ -506,6 +512,7 @@ Symfony is the result of the work of many people who made the code better
- Roy Van Ginneken (rvanginneken) - Roy Van Ginneken (rvanginneken)
- ondrowan - ondrowan
- Barry vd. Heuvel (barryvdh) - Barry vd. Heuvel (barryvdh)
- Craig Duncan (duncan3dc)
- Sébastien Alfaiate (seb33300) - Sébastien Alfaiate (seb33300)
- Evan S Kaufman (evanskaufman) - Evan S Kaufman (evanskaufman)
- mcben - mcben
@ -513,7 +520,6 @@ Symfony is the result of the work of many people who made the code better
- Maks Slesarenko - Maks Slesarenko
- Filip Procházka (fprochazka) - Filip Procházka (fprochazka)
- mmoreram - mmoreram
- Smaine Milianni (ismail1432)
- Markus Lanthaler (lanthaler) - Markus Lanthaler (lanthaler)
- Remi Collet - Remi Collet
- Vicent Soria Durá (vicentgodella) - Vicent Soria Durá (vicentgodella)
@ -529,7 +535,6 @@ Symfony is the result of the work of many people who made the code better
- Erik Trapman (eriktrapman) - Erik Trapman (eriktrapman)
- De Cock Xavier (xdecock) - De Cock Xavier (xdecock)
- Almog Baku (almogbaku) - Almog Baku (almogbaku)
- George Mponos (gmponos)
- Scott Arciszewski - Scott Arciszewski
- Xavier HAUSHERR - Xavier HAUSHERR
- Norbert Orzechowicz (norzechowicz) - Norbert Orzechowicz (norzechowicz)
@ -543,6 +548,7 @@ Symfony is the result of the work of many people who made the code better
- Nate (frickenate) - Nate (frickenate)
- Timothée Barray (tyx) - Timothée Barray (tyx)
- jhonnyL - jhonnyL
- Grenier Kévin (mcsky_biig)
- sasezaki - sasezaki
- Dawid Pakuła (zulusx) - Dawid Pakuła (zulusx)
- Florian Rey (nervo) - Florian Rey (nervo)
@ -579,6 +585,7 @@ Symfony is the result of the work of many people who made the code better
- Jan Behrens - Jan Behrens
- Mantas Var (mvar) - Mantas Var (mvar)
- Sebastian Krebs - Sebastian Krebs
- Laurent VOULLEMIER (lvo)
- Jean-Christophe Cuvelier [Artack] - Jean-Christophe Cuvelier [Artack]
- Simon DELICATA - Simon DELICATA
- alcaeus - alcaeus
@ -625,12 +632,10 @@ Symfony is the result of the work of many people who made the code better
- Erkhembayar Gantulga (erheme318) - Erkhembayar Gantulga (erheme318)
- Michal Trojanowski - Michal Trojanowski
- David Fuhr - David Fuhr
- Kamil Kokot (pamil)
- Max Grigorian (maxakawizard) - Max Grigorian (maxakawizard)
- DerManoMann - DerManoMann
- Rostyslav Kinash - Rostyslav Kinash
- Maciej Malarz (malarzm) - Maciej Malarz (malarzm)
- Pascal Luna (skalpa)
- Daisuke Ohata - Daisuke Ohata
- Vincent Simonin - Vincent Simonin
- Alex Bogomazov (alebo) - Alex Bogomazov (alebo)
@ -638,6 +643,7 @@ Symfony is the result of the work of many people who made the code better
- adev - adev
- Stefan Warman - Stefan Warman
- Arkadius Stefanski (arkadius) - Arkadius Stefanski (arkadius)
- Gonzalo Vilaseca (gonzalovilaseca)
- Tristan Maindron (tmaindron) - Tristan Maindron (tmaindron)
- Wesley Lancel - Wesley Lancel
- Ke WANG (yktd26) - Ke WANG (yktd26)
@ -645,6 +651,7 @@ Symfony is the result of the work of many people who made the code better
- Strate - Strate
- Anton A. Sumin - Anton A. Sumin
- Israel J. Carberry - Israel J. Carberry
- Tim Goudriaan (codedmonkey)
- Miquel Rodríguez Telep (mrtorrent) - Miquel Rodríguez Telep (mrtorrent)
- Sergey Kolodyazhnyy (skolodyazhnyy) - Sergey Kolodyazhnyy (skolodyazhnyy)
- umpirski - umpirski
@ -665,6 +672,7 @@ Symfony is the result of the work of many people who made the code better
- Jaroslav Kuba - Jaroslav Kuba
- Stephan Vock - Stephan Vock
- Benjamin Zikarsky (bzikarsky) - Benjamin Zikarsky (bzikarsky)
- Roberto Espinoza (respinoza)
- Simon Schick (simonsimcity) - Simon Schick (simonsimcity)
- redstar504 - redstar504
- Tristan Roussel - Tristan Roussel
@ -716,7 +724,7 @@ Symfony is the result of the work of many people who made the code better
- Pierre Rineau - Pierre Rineau
- Vladyslav Petrovych - Vladyslav Petrovych
- Alex Xandra Albert Sim - Alex Xandra Albert Sim
- Craig Duncan (duncan3dc) - Alexander Schranz (alexander-schranz)
- Carson Full - Carson Full
- Sergey Yastrebov - Sergey Yastrebov
- Trent Steel (trsteel88) - Trent Steel (trsteel88)
@ -787,14 +795,17 @@ Symfony is the result of the work of many people who made the code better
- Patrick Dawkins (pjcdawkins) - Patrick Dawkins (pjcdawkins)
- Paul Kamer (pkamer) - Paul Kamer (pkamer)
- Rafał Wrzeszcz (rafalwrzeszcz) - Rafał Wrzeszcz (rafalwrzeszcz)
- Vincent CHALAMON (vincentchalamon)
- Reen Lokum - Reen Lokum
- Martin Parsiegla (spea) - Martin Parsiegla (spea)
- Nguyen Xuan Quynh (xuanquynh)
- Quentin Schuler - Quentin Schuler
- Pierre Vanliefland (pvanliefland) - Pierre Vanliefland (pvanliefland)
- Sofiane HADDAG (sofhad) - Sofiane HADDAG (sofhad)
- frost-nzcr4 - frost-nzcr4
- Bozhidar Hristov - Bozhidar Hristov
- Ivan Nikolaev (destillat) - Ivan Nikolaev (destillat)
- Laurent Bassin (lbassin)
- andrey1s - andrey1s
- Abhoryo - Abhoryo
- Fabian Vogler (fabian) - Fabian Vogler (fabian)
@ -819,7 +830,6 @@ Symfony is the result of the work of many people who made the code better
- Ivan Menshykov - Ivan Menshykov
- David Romaní - David Romaní
- Patrick Allaert - Patrick Allaert
- Fabien Bourigault (fbourigault)
- Gustavo Falco (gfalco) - Gustavo Falco (gfalco)
- Matt Robinson (inanimatt) - Matt Robinson (inanimatt)
- Ruud Kamphuis (ruudk) - Ruud Kamphuis (ruudk)
@ -830,6 +840,7 @@ Symfony is the result of the work of many people who made the code better
- Jörn Lang (j.lang) - Jörn Lang (j.lang)
- Omar Yepez (oyepez003) - Omar Yepez (oyepez003)
- Gawain Lynch (gawain) - Gawain Lynch (gawain)
- Samuel NELA (snela)
- mwsaz - mwsaz
- Jelle Kapitein - Jelle Kapitein
- Benoît Bourgeois - Benoît Bourgeois
@ -838,6 +849,7 @@ Symfony is the result of the work of many people who made the code better
- grizlik - grizlik
- Derek ROTH - Derek ROTH
- Ben Johnson - Ben Johnson
- mweimerskirch
- Dmytro Boiko (eagle) - Dmytro Boiko (eagle)
- Shin Ohno (ganchiku) - Shin Ohno (ganchiku)
- Geert De Deckere (geertdd) - Geert De Deckere (geertdd)
@ -870,6 +882,7 @@ Symfony is the result of the work of many people who made the code better
- Adán Lobato (adanlobato) - Adán Lobato (adanlobato)
- Ian Jenkins (jenkoian) - Ian Jenkins (jenkoian)
- Matthew Davis (mdavis1982) - Matthew Davis (mdavis1982)
- Sam Fleming (sam_fleming)
- Maks - Maks
- Antoine LA - Antoine LA
- den - den
@ -880,6 +893,7 @@ Symfony is the result of the work of many people who made the code better
- David Lima - David Lima
- Brian Freytag (brianfreytag) - Brian Freytag (brianfreytag)
- Brunet Laurent (lbrunet) - Brunet Laurent (lbrunet)
- Florent Viel (luxifer)
- Mikhail Yurasov (mym) - Mikhail Yurasov (mym)
- LOUARDI Abdeltif (ouardisoft) - LOUARDI Abdeltif (ouardisoft)
- Robert Gruendler (pulse00) - Robert Gruendler (pulse00)
@ -891,8 +905,10 @@ Symfony is the result of the work of many people who made the code better
- Erik Saunier (snickers) - Erik Saunier (snickers)
- Rootie - Rootie
- Kyle - Kyle
- Daniel Alejandro Castro Arellano (lexcast)
- Raul Fraile (raulfraile) - Raul Fraile (raulfraile)
- sensio - sensio
- Baptiste Leduc (bleduc)
- Sebastien Morel (plopix) - Sebastien Morel (plopix)
- Patrick Kaufmann - Patrick Kaufmann
- Piotr Stankowski - Piotr Stankowski
@ -1023,6 +1039,7 @@ Symfony is the result of the work of many people who made the code better
- Michał Strzelecki - Michał Strzelecki
- hugofonseca (fonsecas72) - hugofonseca (fonsecas72)
- Martynas Narbutas - Martynas Narbutas
- Toon Verwerft (veewee)
- Bailey Parker - Bailey Parker
- Eddie Jaoude - Eddie Jaoude
- Antanas Arvasevicius - Antanas Arvasevicius
@ -1056,13 +1073,14 @@ Symfony is the result of the work of many people who made the code better
- Alexander Cheprasov - Alexander Cheprasov
- Rodrigo Díez Villamuera (rodrigodiez) - Rodrigo Díez Villamuera (rodrigodiez)
- e-ivanov - e-ivanov
- Roberto Espinoza (respinoza)
- Einenlum - Einenlum
- Jochen Bayer (jocl) - Jochen Bayer (jocl)
- Patrick Carlo-Hickman - Patrick Carlo-Hickman
- Bruno MATEU
- Alex Bowers - Alex Bowers
- Jeremy Bush - Jeremy Bush
- wizhippo - wizhippo
- Mathias STRASSER (roukmoute)
- Thomason, James - Thomason, James
- Viacheslav Sychov - Viacheslav Sychov
- Helmut Hummel (helhum) - Helmut Hummel (helhum)
@ -1105,6 +1123,7 @@ Symfony is the result of the work of many people who made the code better
- Pawel Smolinski - Pawel Smolinski
- Oxan van Leeuwen - Oxan van Leeuwen
- pkowalczyk - pkowalczyk
- Soner Sayakci
- Max Voloshin (maxvoloshin) - Max Voloshin (maxvoloshin)
- Nicolas Fabre (nfabre) - Nicolas Fabre (nfabre)
- Raul Rodriguez (raul782) - Raul Rodriguez (raul782)
@ -1117,6 +1136,7 @@ Symfony is the result of the work of many people who made the code better
- Felicitus - Felicitus
- Krzysztof Przybyszewski - Krzysztof Przybyszewski
- alexpozzi - alexpozzi
- Frederic Godfrin
- Paul Matthews - Paul Matthews
- Jakub Kisielewski - Jakub Kisielewski
- Vacheslav Silyutin - Vacheslav Silyutin
@ -1206,6 +1226,7 @@ Symfony is the result of the work of many people who made the code better
- Juanmi Rodriguez Cerón - Juanmi Rodriguez Cerón
- Andy Raines - Andy Raines
- Anthony Ferrara - Anthony Ferrara
- Geoffrey Pécro (gpekz)
- Klaas Cuvelier (kcuvelier) - Klaas Cuvelier (kcuvelier)
- Mathieu TUDISCO (mathieutu) - Mathieu TUDISCO (mathieutu)
- markusu49 - markusu49
@ -1231,12 +1252,12 @@ Symfony is the result of the work of many people who made the code better
- Andreas Frömer - Andreas Frömer
- Philip Frank - Philip Frank
- Lance McNearney - Lance McNearney
- Gonzalo Vilaseca (gonzalovilaseca)
- Giorgio Premi - Giorgio Premi
- Andrew Berry - Andrew Berry
- ncou - ncou
- Ian Carroll - Ian Carroll
- caponica - caponica
- Daniel Kay (danielkay-cp)
- Matt Daum (daum) - Matt Daum (daum)
- Alberto Pirovano (geezmo) - Alberto Pirovano (geezmo)
- Nicolas LEFEVRE (nicoweb) - Nicolas LEFEVRE (nicoweb)
@ -1271,7 +1292,6 @@ Symfony is the result of the work of many people who made the code better
- Max Romanovsky (maxromanovsky) - Max Romanovsky (maxromanovsky)
- Mathieu Morlon - Mathieu Morlon
- Daniel Tschinder - Daniel Tschinder
- Alexander Schranz
- Arnaud CHASSEUX - Arnaud CHASSEUX
- Rafał Muszyński (rafmus90) - Rafał Muszyński (rafmus90)
- Sébastien Decrême (sebdec) - Sébastien Decrême (sebdec)
@ -1368,6 +1388,8 @@ Symfony is the result of the work of many people who made the code better
- Jakub Simon - Jakub Simon
- Bouke Haarsma - Bouke Haarsma
- Evert Harmeling - Evert Harmeling
- mschop
- Alan Poulain
- Martin Eckhardt - Martin Eckhardt
- natechicago - natechicago
- Jonathan Poston - Jonathan Poston
@ -1403,12 +1425,14 @@ Symfony is the result of the work of many people who made the code better
- Jake Bishop (yakobeyak) - Jake Bishop (yakobeyak)
- Dan Blows - Dan Blows
- Matt Wells - Matt Wells
- Sander van der Vlugt
- Nicolas Appriou - Nicolas Appriou
- stloyd - stloyd
- Andreas - Andreas
- Chris Tickner - Chris Tickner
- BoShurik - BoShurik
- Andrew Coulton - Andrew Coulton
- Ulugbek Miniyarov
- Jeremy Benoist - Jeremy Benoist
- Michal Gebauer - Michal Gebauer
- Gleb Sidora - Gleb Sidora
@ -1441,9 +1465,9 @@ Symfony is the result of the work of many people who made the code better
- Kamil Madejski - Kamil Madejski
- Jeremiah VALERIE - Jeremiah VALERIE
- Mike Francis - Mike Francis
- Gerd Christian Kunze (derdu)
- Christoph Nissle (derstoffel) - Christoph Nissle (derstoffel)
- Ionel Scutelnicu (ionelscutelnicu) - Ionel Scutelnicu (ionelscutelnicu)
- Grenier Kévin (mcsky_biig)
- Nicolas Tallefourtané (nicolab) - Nicolas Tallefourtané (nicolab)
- Botond Dani (picur) - Botond Dani (picur)
- Thierry Marianne (thierrymarianne) - Thierry Marianne (thierrymarianne)
@ -1461,6 +1485,7 @@ Symfony is the result of the work of many people who made the code better
- Maksym Slesarenko (maksym_slesarenko) - Maksym Slesarenko (maksym_slesarenko)
- Michal Kurzeja (mkurzeja) - Michal Kurzeja (mkurzeja)
- Nicolas Bastien (nicolas_bastien) - Nicolas Bastien (nicolas_bastien)
- Nikola Svitlica (thecelavi)
- Denis (yethee) - Denis (yethee)
- Andrew Zhilin (zhil) - Andrew Zhilin (zhil)
- Sjors Ottjes - Sjors Ottjes
@ -1504,6 +1529,7 @@ Symfony is the result of the work of many people who made the code better
- Robin Duval (robin-duval) - Robin Duval (robin-duval)
- Grinbergs Reinis (shima5) - Grinbergs Reinis (shima5)
- Artem Lopata (bumz) - Artem Lopata (bumz)
- alex
- Nicole Cordes - Nicole Cordes
- Roman Orlov - Roman Orlov
- VolCh - VolCh
@ -1530,6 +1556,7 @@ Symfony is the result of the work of many people who made the code better
- Dmitry Korotovsky - Dmitry Korotovsky
- mcorteel - mcorteel
- Michael van Tricht - Michael van Tricht
- ReScO
- Tim Strehle - Tim Strehle
- Sam Ward - Sam Ward
- Walther Lalk - Walther Lalk
@ -1553,8 +1580,10 @@ Symfony is the result of the work of many people who made the code better
- Dmitriy Fedorenko - Dmitriy Fedorenko
- vlakoff - vlakoff
- bertillon - bertillon
- Rudolf Ratusiński
- Bertalan Attila - Bertalan Attila
- AmsTaFF (amstaff) - AmsTaFF (amstaff)
- Simon Müller (boscho)
- Yannick Bensacq (cibou) - Yannick Bensacq (cibou)
- Frédéric G. Marand (fgm) - Frédéric G. Marand (fgm)
- Freek Van der Herten (freekmurze) - Freek Van der Herten (freekmurze)
@ -1569,6 +1598,7 @@ Symfony is the result of the work of many people who made the code better
- Rares Vlaseanu (raresvla) - Rares Vlaseanu (raresvla)
- tante kinast (tante) - tante kinast (tante)
- Vincent LEFORT (vlefort) - Vincent LEFORT (vlefort)
- Darryl Hein (xmmedia)
- Sadicov Vladimir (xtech) - Sadicov Vladimir (xtech)
- Kevin EMO (zarcox) - Kevin EMO (zarcox)
- Alexander Zogheb - Alexander Zogheb
@ -1620,6 +1650,7 @@ Symfony is the result of the work of many people who made the code better
- Matthieu Prat - Matthieu Prat
- Ion Bazan - Ion Bazan
- Grummfy - Grummfy
- Paul Le Corre
- Filipe Guerra - Filipe Guerra
- Jean Ragouin - Jean Ragouin
- Gerben Wijnja - Gerben Wijnja
@ -1636,7 +1667,7 @@ Symfony is the result of the work of many people who made the code better
- Erik van Wingerden - Erik van Wingerden
- Valouleloup - Valouleloup
- Dane Powell - Dane Powell
- mweimerskirch - Alexis MARQUIS
- Gerrit Drost - Gerrit Drost
- Linnaea Von Lavia - Linnaea Von Lavia
- Simon Mönch - Simon Mönch
@ -1655,6 +1686,7 @@ Symfony is the result of the work of many people who made the code better
- Klaas Naaijkens - Klaas Naaijkens
- Daniel González Cerviño - Daniel González Cerviño
- Rafał - Rafał
- Achilles Kaloeridis (achilles)
- Adria Lopez (adlpz) - Adria Lopez (adlpz)
- Aaron Scherer (aequasi) - Aaron Scherer (aequasi)
- Rosio (ben-rosio) - Rosio (ben-rosio)
@ -1688,6 +1720,7 @@ Symfony is the result of the work of many people who made the code better
- mlpo (mlpo) - mlpo (mlpo)
- Marek Šimeček (mssimi) - Marek Šimeček (mssimi)
- Cayetano Soriano Gallego (neoshadybeat) - Cayetano Soriano Gallego (neoshadybeat)
- Olivier Laviale (olvlvl)
- Ondrej Machulda (ondram) - Ondrej Machulda (ondram)
- Pablo Monterde Perez (plebs) - Pablo Monterde Perez (plebs)
- Jimmy Leger (redpanda) - Jimmy Leger (redpanda)
@ -1798,7 +1831,6 @@ Symfony is the result of the work of many people who made the code better
- Guillaume Aveline - Guillaume Aveline
- Adrian Philipp - Adrian Philipp
- James Michael DuPont - James Michael DuPont
- Tim Goudriaan
- Kasperki - Kasperki
- Tammy D - Tammy D
- Daniel STANCU - Daniel STANCU
@ -1875,6 +1907,7 @@ Symfony is the result of the work of many people who made the code better
- phc - phc
- Дмитрий Пацура - Дмитрий Пацура
- ilyes kooli - ilyes kooli
- Marko Kaznovac
- Matthias Althaus - Matthias Althaus
- Michaël VEROUX - Michaël VEROUX
- Julia - Julia
@ -1937,7 +1970,6 @@ Symfony is the result of the work of many people who made the code better
- samuel laulhau (lalop) - samuel laulhau (lalop)
- Laurent Bachelier (laurentb) - Laurent Bachelier (laurentb)
- Luís Cobucci (lcobucci) - Luís Cobucci (lcobucci)
- Florent Viel (luxifer)
- Matthieu Mota (matthieumota) - Matthieu Mota (matthieumota)
- Matthieu Moquet (mattketmo) - Matthieu Moquet (mattketmo)
- Moritz Borgmann (mborgmann) - Moritz Borgmann (mborgmann)
@ -1982,7 +2014,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)
- Vincent CHALAMON (vincentchalamon)
- David Herrmann (vworldat) - David Herrmann (vworldat)
- Eugene Babushkin (warl) - Eugene Babushkin (warl)
- Wouter Sioen (wouter_sioen) - Wouter Sioen (wouter_sioen)
@ -2025,13 +2056,11 @@ Symfony is the result of the work of many people who made the code better
- Henne Van Och (hennevo) - Henne Van Och (hennevo)
- Jeroen De Dauw (jeroendedauw) - Jeroen De Dauw (jeroendedauw)
- Jonathan Scheiber (jmsche) - Jonathan Scheiber (jmsche)
- Daniel Alejandro Castro Arellano (lexcast)
- Maxime COLIN (maximecolin) - Maxime COLIN (maximecolin)
- Muharrem Demirci (mdemirci) - Muharrem Demirci (mdemirci)
- Evgeny Z (meze) - Evgeny Z (meze)
- Nicolas de Marqué (nicola) - Nicolas de Marqué (nicola)
- Pierre Geyer (ptheg) - Pierre Geyer (ptheg)
- Sam Fleming (sam_fleming)
- Thomas BERTRAND (sevrahk) - Thomas BERTRAND (sevrahk)
- Matej Žilák (teo_sk) - Matej Žilák (teo_sk)
- Vladislav Vlastovskiy (vlastv) - Vladislav Vlastovskiy (vlastv)

View File

@ -92,7 +92,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
if (file_exists("phpunit-$PHPUNIT_VERSION")) { if (file_exists("phpunit-$PHPUNIT_VERSION")) {
passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? '(del /S /F /Q %s & rmdir %1$s) >nul': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION")); passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? '(del /S /F /Q %s & rmdir %1$s) >nul': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION"));
} }
if (extension_loaded('openssl') && ini_get('allow_url_fopen') && !isset($_SERVER['http_proxy']) && !isset($_SERVER['https_proxy'])) { if (extension_loaded('openssl') && filter_var(ini_get('allow_url_fopen'), FILTER_VALIDATE_BOOLEAN) && !isset($_SERVER['http_proxy']) && !isset($_SERVER['https_proxy'])) {
$remoteZip = "https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip"; $remoteZip = "https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip";
$remoteZipStream = @fopen($remoteZip, 'rb'); $remoteZipStream = @fopen($remoteZip, 'rb');
if (!$remoteZipStream) { if (!$remoteZipStream) {
@ -243,7 +243,7 @@ if ($components) {
// STATUS_STACK_BUFFER_OVERRUN (-1073740791/0xC0000409) // STATUS_STACK_BUFFER_OVERRUN (-1073740791/0xC0000409)
// STATUS_ACCESS_VIOLATION (-1073741819/0xC0000005) // STATUS_ACCESS_VIOLATION (-1073741819/0xC0000005)
// STATUS_HEAP_CORRUPTION (-1073740940/0xC0000374) // STATUS_HEAP_CORRUPTION (-1073740940/0xC0000374)
if ($procStatus && ('\\' !== DIRECTORY_SEPARATOR || !extension_loaded('apcu') || !ini_get('apc.enable_cli') || !in_array($procStatus, array(-1073740791, -1073741819, -1073740940)))) { if ($procStatus && ('\\' !== DIRECTORY_SEPARATOR || !extension_loaded('apcu') || !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN) || !in_array($procStatus, array(-1073740791, -1073741819, -1073740940)))) {
$exit = $procStatus; $exit = $procStatus;
echo "\033[41mKO\033[0m $component\n\n"; echo "\033[41mKO\033[0m $component\n\n";
} else { } else {

View File

@ -83,8 +83,8 @@ EOT
array('Architecture', (PHP_INT_SIZE * 8).' bits'), array('Architecture', (PHP_INT_SIZE * 8).' bits'),
array('Intl locale', class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a'), array('Intl locale', class_exists('Locale', false) && \Locale::getDefault() ? \Locale::getDefault() : 'n/a'),
array('Timezone', date_default_timezone_get().' (<comment>'.(new \DateTime())->format(\DateTime::W3C).'</>)'), array('Timezone', date_default_timezone_get().' (<comment>'.(new \DateTime())->format(\DateTime::W3C).'</>)'),
array('OPcache', \extension_loaded('Zend OPcache') && ini_get('opcache.enable') ? 'true' : 'false'), array('OPcache', \extension_loaded('Zend OPcache') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'),
array('APCu', \extension_loaded('apcu') && ini_get('apc.enabled') ? 'true' : 'false'), array('APCu', \extension_loaded('apcu') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? 'true' : 'false'),
array('Xdebug', \extension_loaded('xdebug') ? 'true' : 'false'), array('Xdebug', \extension_loaded('xdebug') ? 'true' : 'false'),
); );

View File

@ -344,6 +344,20 @@ class JsonDescriptor extends Descriptor
if ($callable instanceof \Closure) { if ($callable instanceof \Closure) {
$data['type'] = 'closure'; $data['type'] = 'closure';
$r = new \ReflectionFunction($callable);
if (false !== strpos($r->name, '{closure}')) {
return $data;
}
$data['name'] = $r->name;
$class = ($class = $r->getClosureThis()) ? \get_class($class) : null;
if ($scopeClass = $r->getClosureScopeClass() ?: $class) {
$data['class'] = $scopeClass;
if (!$class) {
$data['static'] = true;
}
}
return $data; return $data;
} }

View File

@ -353,6 +353,20 @@ class MarkdownDescriptor extends Descriptor
if ($callable instanceof \Closure) { if ($callable instanceof \Closure) {
$string .= "\n- Type: `closure`"; $string .= "\n- Type: `closure`";
$r = new \ReflectionFunction($callable);
if (false !== strpos($r->name, '{closure}')) {
return $this->write($string."\n");
}
$string .= "\n".sprintf('- Name: `%s`', $r->name);
$class = ($class = $r->getClosureThis()) ? \get_class($class) : null;
if ($scopeClass = $r->getClosureScopeClass() ?: $class) {
$string .= "\n".sprintf('- Class: `%s`', $class);
if (!$class) {
$string .= "\n- Static: yes";
}
}
return $this->write($string."\n"); return $this->write($string."\n");
} }

View File

@ -57,12 +57,7 @@ class TextDescriptor extends Descriptor
if ($showControllers) { if ($showControllers) {
$controller = $route->getDefault('_controller'); $controller = $route->getDefault('_controller');
if ($controller instanceof \Closure) { $row[] = $this->formatCallable($controller);
$controller = 'Closure';
} elseif (\is_object($controller)) {
$controller = \get_class($controller);
}
$row[] = $controller;
} }
$tableRows[] = $row; $tableRows[] = $row;
@ -464,7 +459,18 @@ class TextDescriptor extends Descriptor
} }
if ($callable instanceof \Closure) { if ($callable instanceof \Closure) {
return '\Closure()'; $r = new \ReflectionFunction($callable);
if (false !== strpos($r->name, '{closure}')) {
return 'Closure()';
}
if ($class = $r->getClosureScopeClass()) {
return sprintf('%s::%s()', $class, $r->name);
}
if ($class = $r->getClosureThis()) {
return sprintf('%s::%s()', \get_class($class), $r->name);
}
return $r->name.'()';
} }
if (method_exists($callable, '__invoke')) { if (method_exists($callable, '__invoke')) {

View File

@ -524,6 +524,20 @@ class XmlDescriptor extends Descriptor
if ($callable instanceof \Closure) { if ($callable instanceof \Closure) {
$callableXML->setAttribute('type', 'closure'); $callableXML->setAttribute('type', 'closure');
$r = new \ReflectionFunction($callable);
if (false !== strpos($r->name, '{closure}')) {
return $dom;
}
$callableXML->setAttribute('name', $r->name);
$class = ($class = $r->getClosureThis()) ? \get_class($class) : null;
if ($scopeClass = $r->getClosureScopeClass() ?: $class) {
$callableXML->setAttribute('class', $class);
if (!$class) {
$callableXML->setAttribute('static', 'true');
}
}
return $dom; return $dom;
} }

View File

@ -6,6 +6,6 @@
 Order   Callable   Priority   Order   Callable   Priority 
------- ------------------- ---------- ------- ------------------- ----------
#1 global_function() 255 #1 global_function() 255
#2 \Closure() -1 #2 Closure() -1
------- ------------------- ---------- ------- ------------------- ----------

View File

@ -9,7 +9,7 @@
 Order   Callable   Priority   Order   Callable   Priority 
------- ------------------- ---------- ------- ------------------- ----------
#1 global_function() 255 #1 global_function() 255
#2 \Closure() -1 #2 Closure() -1
------- ------------------- ---------- ------- ------------------- ----------
"event2" event "event2" event

View File

@ -122,7 +122,7 @@ abstract class AbstractAdapter implements AdapterInterface, CacheInterface, Logg
} }
$apcu = new ApcuAdapter($namespace, (int) $defaultLifetime / 5, $version); $apcu = new ApcuAdapter($namespace, (int) $defaultLifetime / 5, $version);
if ('cli' === \PHP_SAPI && !ini_get('apc.enable_cli')) { if ('cli' === \PHP_SAPI && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
$apcu->setLogger(new NullLogger()); $apcu->setLogger(new NullLogger());
} elseif (null !== $logger) { } elseif (null !== $logger) {
$apcu->setLogger($logger); $apcu->setLogger($logger);

View File

@ -68,7 +68,7 @@ class PhpArrayAdapter implements AdapterInterface, CacheInterface, PruneableInte
public static function create($file, CacheItemPoolInterface $fallbackPool) public static function create($file, CacheItemPoolInterface $fallbackPool)
{ {
// Shared memory is available in PHP 7.0+ with OPCache enabled // Shared memory is available in PHP 7.0+ with OPCache enabled
if (ini_get('opcache.enable')) { if (filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
if (!$fallbackPool instanceof AdapterInterface) { if (!$fallbackPool instanceof AdapterInterface) {
$fallbackPool = new ProxyAdapter($fallbackPool); $fallbackPool = new ProxyAdapter($fallbackPool);
} }

View File

@ -48,7 +48,7 @@ class PhpArrayCache implements CacheInterface, PruneableInterface, ResettableInt
public static function create($file, CacheInterface $fallbackPool) public static function create($file, CacheInterface $fallbackPool)
{ {
// Shared memory is available in PHP 7.0+ with OPCache enabled // Shared memory is available in PHP 7.0+ with OPCache enabled
if (ini_get('opcache.enable')) { if (filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
return new static($file, $fallbackPool); return new static($file, $fallbackPool);
} }

View File

@ -24,10 +24,10 @@ class ApcuAdapterTest extends AdapterTestCase
public function createCachePool($defaultLifetime = 0) public function createCachePool($defaultLifetime = 0)
{ {
if (!\function_exists('apcu_fetch') || !ini_get('apc.enabled')) { if (!\function_exists('apcu_fetch') || !filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN)) {
$this->markTestSkipped('APCu extension is required.'); $this->markTestSkipped('APCu extension is required.');
} }
if ('cli' === \PHP_SAPI && !ini_get('apc.enable_cli')) { if ('cli' === \PHP_SAPI && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
if ('testWithCliSapi' !== $this->getName()) { if ('testWithCliSapi' !== $this->getName()) {
$this->markTestSkipped('apc.enable_cli=1 is required.'); $this->markTestSkipped('apc.enable_cli=1 is required.');
} }

View File

@ -137,7 +137,7 @@ class MemcachedAdapterTest extends AdapterTestCase
'localhost', 'localhost',
11222, 11222,
); );
if (ini_get('memcached.use_sasl')) { if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) {
yield array( yield array(
'memcached://user:password@127.0.0.1?weight=50', 'memcached://user:password@127.0.0.1?weight=50',
'127.0.0.1', '127.0.0.1',
@ -154,7 +154,7 @@ class MemcachedAdapterTest extends AdapterTestCase
'/var/local/run/memcached.socket', '/var/local/run/memcached.socket',
0, 0,
); );
if (ini_get('memcached.use_sasl')) { if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) {
yield array( yield array(
'memcached://user:password@/var/local/run/memcached.socket?weight=25', 'memcached://user:password@/var/local/run/memcached.socket?weight=25',
'/var/local/run/memcached.socket', '/var/local/run/memcached.socket',

View File

@ -23,7 +23,7 @@ class ApcuCacheTest extends CacheTestCase
public function createSimpleCache($defaultLifetime = 0) public function createSimpleCache($defaultLifetime = 0)
{ {
if (!\function_exists('apcu_fetch') || !ini_get('apc.enabled') || ('cli' === \PHP_SAPI && !ini_get('apc.enable_cli'))) { if (!\function_exists('apcu_fetch') || !filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) || ('cli' === \PHP_SAPI && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN))) {
$this->markTestSkipped('APCu extension is required.'); $this->markTestSkipped('APCu extension is required.');
} }
if ('\\' === \DIRECTORY_SEPARATOR) { if ('\\' === \DIRECTORY_SEPARATOR) {

View File

@ -146,7 +146,7 @@ class MemcachedCacheTest extends CacheTestCase
'localhost', 'localhost',
11222, 11222,
); );
if (ini_get('memcached.use_sasl')) { if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) {
yield array( yield array(
'memcached://user:password@127.0.0.1?weight=50', 'memcached://user:password@127.0.0.1?weight=50',
'127.0.0.1', '127.0.0.1',
@ -163,7 +163,7 @@ class MemcachedCacheTest extends CacheTestCase
'/var/local/run/memcached.socket', '/var/local/run/memcached.socket',
0, 0,
); );
if (ini_get('memcached.use_sasl')) { if (filter_var(ini_get('memcached.use_sasl'), FILTER_VALIDATE_BOOLEAN)) {
yield array( yield array(
'memcached://user:password@/var/local/run/memcached.socket?weight=25', 'memcached://user:password@/var/local/run/memcached.socket?weight=25',
'/var/local/run/memcached.socket', '/var/local/run/memcached.socket',

View File

@ -23,7 +23,7 @@ trait ApcuTrait
{ {
public static function isSupported() public static function isSupported()
{ {
return \function_exists('apcu_fetch') && ini_get('apc.enabled'); return \function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN);
} }
private function init($namespace, $defaultLifetime, $version) private function init($namespace, $defaultLifetime, $version)
@ -81,7 +81,7 @@ trait ApcuTrait
*/ */
protected function doClear($namespace) protected function doClear($namespace)
{ {
return isset($namespace[0]) && class_exists('APCuIterator', false) && ('cli' !== \PHP_SAPI || ini_get('apc.enable_cli')) return isset($namespace[0]) && class_exists('APCuIterator', false) && ('cli' !== \PHP_SAPI || filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN))
? apcu_delete(new \APCuIterator(sprintf('/^%s/', preg_quote($namespace, '/')), APC_ITER_KEY)) ? apcu_delete(new \APCuIterator(sprintf('/^%s/', preg_quote($namespace, '/')), APC_ITER_KEY))
: apcu_clear_cache(); : apcu_clear_cache();
} }

View File

@ -40,7 +40,7 @@ trait PhpFilesTrait
{ {
self::$startTime = self::$startTime ?? $_SERVER['REQUEST_TIME'] ?? time(); self::$startTime = self::$startTime ?? $_SERVER['REQUEST_TIME'] ?? time();
return \function_exists('opcache_invalidate') && ini_get('opcache.enable') && ('cli' !== \PHP_SAPI || ini_get('opcache.enable_cli')); return \function_exists('opcache_invalidate') && ('cli' !== \PHP_SAPI || filter_var(ini_get('opcache.enable_cli'), FILTER_VALIDATE_BOOLEAN)) && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN);
} }
/** /**

View File

@ -369,7 +369,17 @@ class AutowirePass extends AbstractRecursivePass
private function createTypeNotFoundMessage(TypedReference $reference, $label) private function createTypeNotFoundMessage(TypedReference $reference, $label)
{ {
if (!$r = $this->container->getReflectionClass($type = $reference->getType(), false)) { $trackResources = $this->container->isTrackingResources();
$this->container->setResourceTracking(false);
try {
if ($r = $this->container->getReflectionClass($type = $reference->getType(), false)) {
$alternatives = $this->createTypeAlternatives($reference);
}
} finally {
$this->container->setResourceTracking($trackResources);
}
if (!$r) {
// either $type does not exist or a parent class does not exist // either $type does not exist or a parent class does not exist
try { try {
$resource = new ClassExistenceResource($type, false); $resource = new ClassExistenceResource($type, false);
@ -382,7 +392,6 @@ class AutowirePass extends AbstractRecursivePass
$message = sprintf('has type "%s" but this class %s.', $type, $parentMsg ? sprintf('is missing a parent class (%s)', $parentMsg) : 'was not found'); $message = sprintf('has type "%s" but this class %s.', $type, $parentMsg ? sprintf('is missing a parent class (%s)', $parentMsg) : 'was not found');
} else { } else {
$alternatives = $this->createTypeAlternatives($reference);
$message = $this->container->has($type) ? 'this service is abstract' : 'no such service exists'; $message = $this->container->has($type) ? 'this service is abstract' : 'no such service exists';
$message = sprintf('references %s "%s" but %s.%s', $r->isInterface() ? 'interface' : 'class', $type, $message, $alternatives); $message = sprintf('references %s "%s" but %s.%s', $r->isInterface() ? 'interface' : 'class', $type, $message, $alternatives);

View File

@ -346,7 +346,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
try { try {
if (isset($this->classReflectors[$class])) { if (isset($this->classReflectors[$class])) {
$classReflector = $this->classReflectors[$class]; $classReflector = $this->classReflectors[$class];
} elseif ($this->trackResources) { } elseif (class_exists(ClassExistenceResource::class)) {
$resource = new ClassExistenceResource($class, false); $resource = new ClassExistenceResource($class, false);
$classReflector = $resource->isFresh(0) ? false : new \ReflectionClass($class); $classReflector = $resource->isFresh(0) ? false : new \ReflectionClass($class);
} else { } else {

View File

@ -132,6 +132,14 @@ class GraphvizDumper extends Dumper
$edges[] = array('name' => $name, 'required' => $required, 'to' => $argument, 'lazy' => $lazyEdge); $edges[] = array('name' => $name, 'required' => $required, 'to' => $argument, 'lazy' => $lazyEdge);
} elseif ($argument instanceof ArgumentInterface) { } elseif ($argument instanceof ArgumentInterface) {
$edges = array_merge($edges, $this->findEdges($id, $argument->getValues(), $required, $name, true)); $edges = array_merge($edges, $this->findEdges($id, $argument->getValues(), $required, $name, true));
} elseif ($argument instanceof Definition) {
$edges = array_merge($edges,
$this->findEdges($id, $argument->getArguments(), $required, ''),
$this->findEdges($id, $argument->getProperties(), false, '')
);
foreach ($argument->getMethodCalls() as $call) {
$edges = array_merge($edges, $this->findEdges($id, $call[1], false, $call[0].'()'));
}
} elseif (\is_array($argument)) { } elseif (\is_array($argument)) {
$edges = array_merge($edges, $this->findEdges($id, $argument, $required, $name, $lazy)); $edges = array_merge($edges, $this->findEdges($id, $argument, $required, $name, $lazy));
} }

View File

@ -342,9 +342,13 @@ EOF;
if ($node->getValue() && ($edge->isLazy() || $edge->isWeak())) { if ($node->getValue() && ($edge->isLazy() || $edge->isWeak())) {
// no-op // no-op
} elseif (isset($currentPath[$id])) { } elseif (isset($currentPath[$id])) {
$currentId = $id;
foreach (array_reverse($currentPath) as $parentId) { foreach (array_reverse($currentPath) as $parentId) {
$this->circularReferences[$parentId][$id] = $id; $this->circularReferences[$parentId][$currentId] = $currentId;
$id = $parentId; if ($parentId === $id) {
break;
}
$currentId = $parentId;
} }
} elseif (!isset($checkedNodes[$id])) { } elseif (!isset($checkedNodes[$id])) {
$checkedNodes[$id] = true; $checkedNodes[$id] = true;
@ -459,7 +463,7 @@ EOF;
* @throws InvalidArgumentException * @throws InvalidArgumentException
* @throws RuntimeException * @throws RuntimeException
*/ */
private function addServiceInstance(string $id, Definition $definition, string $isSimpleInstance): string private function addServiceInstance(string $id, Definition $definition, bool $isSimpleInstance): string
{ {
$class = $this->dumpValue($definition->getClass()); $class = $this->dumpValue($definition->getClass());
@ -585,7 +589,7 @@ EOF;
$this->definitionVariables = new \SplObjectStorage(); $this->definitionVariables = new \SplObjectStorage();
$this->referenceVariables = array(); $this->referenceVariables = array();
$this->variableCount = 0; $this->variableCount = 0;
$this->definitionVariables[$definition] = $this->referenceVariables[$id] = new Variable('instance'); $this->referenceVariables[$id] = new Variable('instance');
$return = array(); $return = array();
@ -658,22 +662,7 @@ EOF;
$code .= sprintf(" @trigger_error(%s, E_USER_DEPRECATED);\n\n", $this->export($definition->getDeprecationMessage($id))); $code .= sprintf(" @trigger_error(%s, E_USER_DEPRECATED);\n\n", $this->export($definition->getDeprecationMessage($id)));
} }
$head = $tail = ''; $code .= $this->addInlineService($id, $definition);
$arguments = array($definition->getArguments(), $definition->getFactory());
$this->addInlineVariables($head, $tail, $id, $arguments, true);
$code .= '' !== $head ? $head."\n" : '';
if ($arguments = array_filter(array($definition->getProperties(), $definition->getMethodCalls(), $definition->getConfigurator()))) {
$this->addInlineVariables($tail, $tail, $id, $arguments, false);
$tail .= '' !== $tail ? "\n" : '';
$tail .= $this->addServiceProperties($definition);
$tail .= $this->addServiceMethodCalls($definition);
$tail .= $this->addServiceConfigurator($definition);
}
$code .= $this->addServiceInstance($id, $definition, '' === $tail)
.('' !== $tail ? "\n".$tail."\n return \$instance;\n" : '');
if ($asFile) { if ($asFile) {
$code = implode("\n", array_map(function ($line) { return $line ? substr($line, 8) : $line; }, explode("\n", $code))); $code = implode("\n", array_map(function ($line) { return $line ? substr($line, 8) : $line; }, explode("\n", $code)));
@ -687,35 +676,41 @@ EOF;
return array($file, $code); return array($file, $code);
} }
private function addInlineVariables(string &$head, string &$tail, string $id, array $arguments, bool $forConstructor): bool private function addInlineVariables(string $id, Definition $definition, array $arguments, bool $forConstructor): string
{ {
$hasSelfRef = false; $code = '';
foreach ($arguments as $argument) { foreach ($arguments as $argument) {
if (\is_array($argument)) { if (\is_array($argument)) {
$hasSelfRef = $this->addInlineVariables($head, $tail, $id, $argument, $forConstructor) || $hasSelfRef; $code .= $this->addInlineVariables($id, $definition, $argument, $forConstructor);
} elseif ($argument instanceof Reference) { } elseif ($argument instanceof Reference) {
$hasSelfRef = $this->addInlineReference($head, $id, $argument, $forConstructor) || $hasSelfRef; $code .= $this->addInlineReference($id, $definition, $argument, $forConstructor);
} elseif ($argument instanceof Definition) { } elseif ($argument instanceof Definition) {
$hasSelfRef = $this->addInlineService($head, $tail, $id, $argument, $forConstructor) || $hasSelfRef; $code .= $this->addInlineService($id, $definition, $argument, $forConstructor);
} }
} }
return $hasSelfRef; return $code;
} }
private function addInlineReference(string &$code, string $id, string $targetId, bool $forConstructor): bool private function addInlineReference(string $id, Definition $definition, string $targetId, bool $forConstructor): string
{ {
$hasSelfRef = isset($this->circularReferences[$id][$targetId]); if ($id === $targetId) {
return $this->addInlineService($id, $definition, $definition, $forConstructor);
if ('service_container' === $targetId || isset($this->referenceVariables[$targetId])) {
return $hasSelfRef;
} }
if ('service_container' === $targetId || isset($this->referenceVariables[$targetId])) {
return '';
}
$hasSelfRef = isset($this->circularReferences[$id][$targetId]);
$forConstructor = $forConstructor && !isset($this->definitionVariables[$definition]);
list($callCount, $behavior) = $this->serviceCalls[$targetId]; list($callCount, $behavior) = $this->serviceCalls[$targetId];
if (2 > $callCount && (!$hasSelfRef || !$forConstructor)) { $code = $hasSelfRef && !$forConstructor ? $this->addInlineService($id, $definition, $definition, $forConstructor) : '';
return $hasSelfRef;
if (isset($this->referenceVariables[$targetId]) || (2 > $callCount && (!$hasSelfRef || !$forConstructor))) {
return $code;
} }
$name = $this->getNextVariableName(); $name = $this->getNextVariableName();
@ -725,7 +720,7 @@ EOF;
$code .= sprintf(" \$%s = %s;\n", $name, $this->getServiceCall($targetId, $reference)); $code .= sprintf(" \$%s = %s;\n", $name, $this->getServiceCall($targetId, $reference));
if (!$hasSelfRef || !$forConstructor) { if (!$hasSelfRef || !$forConstructor) {
return $hasSelfRef; return $code;
} }
$code .= sprintf(<<<'EOTXT' $code .= sprintf(<<<'EOTXT'
@ -740,46 +735,56 @@ EOTXT
$id $id
); );
return false; return $code;
} }
private function addInlineService(string &$head, string &$tail, string $id, Definition $definition, bool $forConstructor): bool private function addInlineService(string $id, Definition $definition, Definition $inlineDef = null, bool $forConstructor = true): string
{ {
if (isset($this->definitionVariables[$definition])) { $isSimpleInstance = $isRootInstance = null === $inlineDef;
return false;
if (isset($this->definitionVariables[$inlineDef = $inlineDef ?: $definition])) {
return '';
} }
$arguments = array($definition->getArguments(), $definition->getFactory()); $arguments = array($inlineDef->getArguments(), $inlineDef->getFactory());
if (2 > $this->inlinedDefinitions[$definition] && !$definition->getMethodCalls() && !$definition->getProperties() && !$definition->getConfigurator()) { $code = $this->addInlineVariables($id, $definition, $arguments, $forConstructor);
return $this->addInlineVariables($head, $tail, $id, $arguments, $forConstructor);
if ($arguments = array_filter(array($inlineDef->getProperties(), $inlineDef->getMethodCalls(), $inlineDef->getConfigurator()))) {
$isSimpleInstance = false;
} elseif ($definition !== $inlineDef && 2 > $this->inlinedDefinitions[$inlineDef]) {
return $code;
} }
$name = $this->getNextVariableName(); if (isset($this->definitionVariables[$inlineDef])) {
$this->definitionVariables[$definition] = new Variable($name); $isSimpleInstance = false;
$code = '';
if ($forConstructor) {
$hasSelfRef = $this->addInlineVariables($code, $tail, $id, $arguments, $forConstructor);
} else { } else {
$hasSelfRef = $this->addInlineVariables($code, $code, $id, $arguments, $forConstructor); $name = $definition === $inlineDef ? 'instance' : $this->getNextVariableName();
} $this->definitionVariables[$inlineDef] = new Variable($name);
$code .= $this->addNewInstance($definition, ' $'.$name.' = ', $id); $code .= '' !== $code ? "\n" : '';
$hasSelfRef && !$forConstructor ? $tail .= ('' !== $tail ? "\n" : '').$code : $head .= ('' !== $head ? "\n" : '').$code;
$code = ''; if ('instance' === $name) {
$arguments = array($definition->getProperties(), $definition->getMethodCalls(), $definition->getConfigurator()); $code .= $this->addServiceInstance($id, $definition, $isSimpleInstance);
$hasSelfRef = $this->addInlineVariables($code, $code, $id, $arguments, false) || $hasSelfRef; } else {
$code .= $this->addNewInstance($inlineDef, ' $'.$name.' = ', $id);
}
$code .= '' !== $code ? "\n" : ''; if ('' !== $inline = $this->addInlineVariables($id, $definition, $arguments, false)) {
$code .= $this->addServiceProperties($definition, $name); $code .= "\n".$inline."\n";
$code .= $this->addServiceMethodCalls($definition, $name); } elseif ($arguments && 'instance' === $name) {
$code .= $this->addServiceConfigurator($definition, $name); $code .= "\n";
if ('' !== $code) { }
$hasSelfRef ? $tail .= ('' !== $tail ? "\n" : '').$code : $head .= $code;
$code .= $this->addServiceProperties($inlineDef, $name);
$code .= $this->addServiceMethodCalls($inlineDef, $name);
$code .= $this->addServiceConfigurator($inlineDef, $name);
} }
return $hasSelfRef; if ($isRootInstance && !$isSimpleInstance) {
$code .= "\n return \$instance;\n";
}
return $code;
} }
private function addServices(array &$services = null): string private function addServices(array &$services = null): string

View File

@ -1362,6 +1362,8 @@ class ContainerBuilderTest extends TestCase
$foo6 = $container->get('foo6'); $foo6 = $container->get('foo6');
$this->assertEquals((object) array('bar6' => (object) array()), $foo6); $this->assertEquals((object) array('bar6' => (object) array()), $foo6);
$this->assertInstanceOf(\stdClass::class, $container->get('root'));
} }
public function provideAlmostCircular() public function provideAlmostCircular()

View File

@ -13,7 +13,9 @@ namespace Symfony\Component\DependencyInjection\Tests\Dumper;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Dumper\GraphvizDumper; use Symfony\Component\DependencyInjection\Dumper\GraphvizDumper;
use Symfony\Component\DependencyInjection\Reference;
class GraphvizDumperTest extends TestCase class GraphvizDumperTest extends TestCase
{ {
@ -32,11 +34,11 @@ class GraphvizDumperTest extends TestCase
$container = include self::$fixturesPath.'/containers/container9.php'; $container = include self::$fixturesPath.'/containers/container9.php';
$dumper = new GraphvizDumper($container); $dumper = new GraphvizDumper($container);
$this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services9.dot')), $dumper->dump(), '->dump() dumps services'); $this->assertStringEqualsFile(self::$fixturesPath.'/graphviz/services9.dot', $dumper->dump(), '->dump() dumps services');
$container = include self::$fixturesPath.'/containers/container10.php'; $container = include self::$fixturesPath.'/containers/container10.php';
$dumper = new GraphvizDumper($container); $dumper = new GraphvizDumper($container);
$this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services10.dot')), $dumper->dump(), '->dump() dumps services'); $this->assertStringEqualsFile(self::$fixturesPath.'/graphviz/services10.dot', $dumper->dump(), '->dump() dumps services');
$container = include self::$fixturesPath.'/containers/container10.php'; $container = include self::$fixturesPath.'/containers/container10.php';
$dumper = new GraphvizDumper($container); $dumper = new GraphvizDumper($container);
@ -47,21 +49,21 @@ class GraphvizDumperTest extends TestCase
'node.instance' => array('fillcolor' => 'green', 'style' => 'empty'), 'node.instance' => array('fillcolor' => 'green', 'style' => 'empty'),
'node.definition' => array('fillcolor' => 'grey'), 'node.definition' => array('fillcolor' => 'grey'),
'node.missing' => array('fillcolor' => 'red', 'style' => 'empty'), 'node.missing' => array('fillcolor' => 'red', 'style' => 'empty'),
)), str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services10-1.dot')), '->dump() dumps services'); )), file_get_contents(self::$fixturesPath.'/graphviz/services10-1.dot'), '->dump() dumps services');
} }
public function testDumpWithFrozenContainer() public function testDumpWithFrozenContainer()
{ {
$container = include self::$fixturesPath.'/containers/container13.php'; $container = include self::$fixturesPath.'/containers/container13.php';
$dumper = new GraphvizDumper($container); $dumper = new GraphvizDumper($container);
$this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services13.dot')), $dumper->dump(), '->dump() dumps services'); $this->assertStringEqualsFile(self::$fixturesPath.'/graphviz/services13.dot', $dumper->dump(), '->dump() dumps services');
} }
public function testDumpWithFrozenCustomClassContainer() public function testDumpWithFrozenCustomClassContainer()
{ {
$container = include self::$fixturesPath.'/containers/container14.php'; $container = include self::$fixturesPath.'/containers/container14.php';
$dumper = new GraphvizDumper($container); $dumper = new GraphvizDumper($container);
$this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services14.dot')), $dumper->dump(), '->dump() dumps services'); $this->assertStringEqualsFile(self::$fixturesPath.'/graphviz/services14.dot', $dumper->dump(), '->dump() dumps services');
} }
public function testDumpWithUnresolvedParameter() public function testDumpWithUnresolvedParameter()
@ -69,6 +71,18 @@ class GraphvizDumperTest extends TestCase
$container = include self::$fixturesPath.'/containers/container17.php'; $container = include self::$fixturesPath.'/containers/container17.php';
$dumper = new GraphvizDumper($container); $dumper = new GraphvizDumper($container);
$this->assertEquals(str_replace('%path%', __DIR__, file_get_contents(self::$fixturesPath.'/graphviz/services17.dot')), $dumper->dump(), '->dump() dumps services'); $this->assertStringEqualsFile(self::$fixturesPath.'/graphviz/services17.dot', $dumper->dump(), '->dump() dumps services');
}
public function testDumpWithInlineDefinition()
{
$container = new ContainerBuilder();
$container->register('foo', 'stdClass')->addArgument(
(new Definition('stdClass'))->addArgument(new Reference('bar'))
);
$container->register('bar', 'stdClass');
$dumper = new GraphvizDumper($container);
$this->assertStringEqualsFile(self::$fixturesPath.'/graphviz/services_inline.dot', $dumper->dump(), '->dump() dumps nested references');
} }
} }

View File

@ -880,6 +880,8 @@ class PhpDumperTest extends TestCase
$foo6 = $container->get('foo6'); $foo6 = $container->get('foo6');
$this->assertEquals((object) array('bar6' => (object) array()), $foo6); $this->assertEquals((object) array('bar6' => (object) array()), $foo6);
$this->assertInstanceOf(\stdClass::class, $container->get('root'));
} }
public function provideAlmostCircular() public function provideAlmostCircular()

View File

@ -0,0 +1,19 @@
<?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\Component\DependencyInjection\Tests\Fixtures;
class FooForCircularWithAddCalls
{
public function call(\stdClass $argument)
{
}
}

View File

@ -4,6 +4,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Dumper\PhpDumper; use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Tests\Fixtures\FooForCircularWithAddCalls;
$public = 'public' === $visibility; $public = 'public' === $visibility;
$container = new ContainerBuilder(); $container = new ContainerBuilder();
@ -115,4 +116,33 @@ $container->register('baz6', 'stdClass')
->setPublic(true) ->setPublic(true)
->setProperty('bar6', new Reference('bar6')); ->setProperty('bar6', new Reference('bar6'));
// provided by Christian Schiffler
$container
->register('root', 'stdClass')
->setArguments([new Reference('level2'), new Reference('multiuse1')])
->setPublic(true);
$container
->register('level2', FooForCircularWithAddCalls::class)
->addMethodCall('call', [new Reference('level3')]);
$container->register('multiuse1', 'stdClass');
$container
->register('level3', 'stdClass')
->addArgument(new Reference('level4'));
$container
->register('level4', 'stdClass')
->setArguments([new Reference('multiuse1'), new Reference('level5')]);
$container
->register('level5', 'stdClass')
->addArgument(new Reference('level6'));
$container
->register('level6', FooForCircularWithAddCalls::class)
->addMethodCall('call', [new Reference('level5')]);
return $container; return $container;

View File

@ -0,0 +1,10 @@
digraph sc {
ratio="compress"
node [fontsize="11" fontname="Arial" shape="record"];
edge [fontsize="9" fontname="Arial" color="grey" arrowhead="open" arrowsize="0.5"];
node_service_container [label="service_container (Psr\Container\ContainerInterface, Symfony\Component\DependencyInjection\ContainerInterface)\nSymfony\\Component\\DependencyInjection\\ContainerInterface\n", shape=record, fillcolor="#eeeeee", style="filled"];
node_foo [label="foo\nstdClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
node_bar [label="bar\nstdClass\n", shape=record, fillcolor="#eeeeee", style="filled"];
node_foo -> node_bar [label="" style="filled"];
}

View File

@ -221,7 +221,6 @@ use Symfony\Component\DependencyInjection\Exception\RuntimeException;
$this->services['foo_with_inline'] = $instance = new \Foo(); $this->services['foo_with_inline'] = $instance = new \Foo();
$a = new \Bar(); $a = new \Bar();
$a->pub = 'pub'; $a->pub = 'pub';
$a->setBaz(($this->services['baz'] ?? $this->load('getBazService.php'))); $a->setBaz(($this->services['baz'] ?? $this->load('getBazService.php')));

View File

@ -290,7 +290,6 @@ class ProjectServiceContainer extends Container
$this->services['foo_with_inline'] = $instance = new \Foo(); $this->services['foo_with_inline'] = $instance = new \Foo();
$a = new \Bar(); $a = new \Bar();
$a->pub = 'pub'; $a->pub = 'pub';
$a->setBaz(($this->services['baz'] ?? $this->getBazService())); $a->setBaz(($this->services['baz'] ?? $this->getBazService()));

View File

@ -65,14 +65,13 @@ class ProjectServiceContainer extends Container
$this->services['App\Bus'] = $instance = new \App\Bus($a); $this->services['App\Bus'] = $instance = new \App\Bus($a);
$b = ($this->privates['App\Schema'] ?? $this->getSchemaService()); $b = ($this->privates['App\Schema'] ?? $this->getSchemaService());
$c = new \App\Registry();
$c->processor = array(0 => $a, 1 => $instance);
$d = new \App\Registry(); $d = new \App\Processor($c, $a);
$d->processor = array(0 => $a, 1 => $instance); $instance->handler1 = new \App\Handler1($a, $b, $d);
$c = new \App\Processor($d, $a); $instance->handler2 = new \App\Handler2($a, $b, $d);
$instance->handler1 = new \App\Handler1($a, $b, $c);
$instance->handler2 = new \App\Handler2($a, $b, $c);
return $instance; return $instance;
} }

View File

@ -36,6 +36,7 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Private extends Container
'logger' => 'getLoggerService', 'logger' => 'getLoggerService',
'manager' => 'getManagerService', 'manager' => 'getManagerService',
'manager2' => 'getManager2Service', 'manager2' => 'getManager2Service',
'root' => 'getRootService',
'subscriber' => 'getSubscriberService', 'subscriber' => 'getSubscriberService',
); );
@ -68,7 +69,13 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Private extends Container
'foobar' => true, 'foobar' => true,
'foobar2' => true, 'foobar2' => true,
'foobar3' => true, 'foobar3' => true,
'level2' => true,
'level3' => true,
'level4' => true,
'level5' => true,
'level6' => true,
'logger2' => true, 'logger2' => true,
'multiuse1' => true,
'subscriber2' => true, 'subscriber2' => true,
); );
} }
@ -130,10 +137,10 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Private extends Container
$this->services['connection'] = $instance = new \stdClass($a, $b); $this->services['connection'] = $instance = new \stdClass($a, $b);
$a->subscriber = ($this->services['subscriber'] ?? $this->getSubscriberService());
$b->logger = ($this->services['logger'] ?? $this->getLoggerService()); $b->logger = ($this->services['logger'] ?? $this->getLoggerService());
$a->subscriber = ($this->services['subscriber'] ?? $this->getSubscriberService());
return $instance; return $instance;
} }
@ -146,19 +153,19 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Private extends Container
{ {
$a = new \stdClass(); $a = new \stdClass();
$c = new \stdClass(); $b = new \stdClass();
$this->services['connection2'] = $instance = new \stdClass($a, $c); $this->services['connection2'] = $instance = new \stdClass($a, $b);
$b = ($this->services['manager2'] ?? $this->getManager2Service()); $c = new \stdClass($instance);
$a->subscriber2 = new \stdClass($b); $d = ($this->services['manager2'] ?? $this->getManager2Service());
$d = new \stdClass($instance); $c->handler2 = new \stdClass($d);
$d->handler2 = new \stdClass($b); $b->logger2 = $c;
$c->logger2 = $d; $a->subscriber2 = new \stdClass($d);
return $instance; return $instance;
} }
@ -205,7 +212,6 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Private extends Container
$this->services['foo5'] = $instance = new \stdClass(); $this->services['foo5'] = $instance = new \stdClass();
$a = new \stdClass($instance); $a = new \stdClass($instance);
$a->foo = $instance; $a->foo = $instance;
$instance->bar = $a; $instance->bar = $a;
@ -295,6 +301,22 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Private extends Container
return $this->services['manager2'] = new \stdClass($a); return $this->services['manager2'] = new \stdClass($a);
} }
/**
* Gets the public 'root' shared service.
*
* @return \stdClass
*/
protected function getRootService()
{
$a = new \Symfony\Component\DependencyInjection\Tests\Fixtures\FooForCircularWithAddCalls();
$b = new \stdClass();
$a->call(new \stdClass(new \stdClass($b, ($this->privates['level5'] ?? $this->getLevel5Service()))));
return $this->services['root'] = new \stdClass($a, $b);
}
/** /**
* Gets the public 'subscriber' shared service. * Gets the public 'subscriber' shared service.
* *
@ -326,4 +348,20 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Private extends Container
return $this->privates['bar6'] = new \stdClass($a); return $this->privates['bar6'] = new \stdClass($a);
} }
/**
* Gets the private 'level5' shared service.
*
* @return \stdClass
*/
protected function getLevel5Service()
{
$a = new \Symfony\Component\DependencyInjection\Tests\Fixtures\FooForCircularWithAddCalls();
$this->privates['level5'] = $instance = new \stdClass($a);
$a->call($instance);
return $instance;
}
} }

View File

@ -43,6 +43,7 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container
'logger' => 'getLoggerService', 'logger' => 'getLoggerService',
'manager' => 'getManagerService', 'manager' => 'getManagerService',
'manager2' => 'getManager2Service', 'manager2' => 'getManager2Service',
'root' => 'getRootService',
'subscriber' => 'getSubscriberService', 'subscriber' => 'getSubscriberService',
); );
@ -68,7 +69,13 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container
'bar6' => true, 'bar6' => true,
'config' => true, 'config' => true,
'config2' => true, 'config2' => true,
'level2' => true,
'level3' => true,
'level4' => true,
'level5' => true,
'level6' => true,
'logger2' => true, 'logger2' => true,
'multiuse1' => true,
'subscriber2' => true, 'subscriber2' => true,
); );
} }
@ -165,7 +172,6 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container
$this->services['connection2'] = $instance = new \stdClass(($this->services['dispatcher2'] ?? $this->getDispatcher2Service()), $a); $this->services['connection2'] = $instance = new \stdClass(($this->services['dispatcher2'] ?? $this->getDispatcher2Service()), $a);
$b = new \stdClass($instance); $b = new \stdClass($instance);
$b->handler2 = new \stdClass(($this->services['manager2'] ?? $this->getManager2Service())); $b->handler2 = new \stdClass(($this->services['manager2'] ?? $this->getManager2Service()));
$a->logger2 = $b; $a->logger2 = $b;
@ -385,6 +391,22 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container
return $this->services['manager2'] = new \stdClass($a); return $this->services['manager2'] = new \stdClass($a);
} }
/**
* Gets the public 'root' shared service.
*
* @return \stdClass
*/
protected function getRootService()
{
$a = new \Symfony\Component\DependencyInjection\Tests\Fixtures\FooForCircularWithAddCalls();
$b = new \stdClass();
$a->call(new \stdClass(new \stdClass($b, ($this->privates['level5'] ?? $this->getLevel5Service()))));
return $this->services['root'] = new \stdClass($a, $b);
}
/** /**
* Gets the public 'subscriber' shared service. * Gets the public 'subscriber' shared service.
* *
@ -410,4 +432,20 @@ class Symfony_DI_PhpDumper_Test_Almost_Circular_Public extends Container
return $this->privates['bar6'] = new \stdClass($a); return $this->privates['bar6'] = new \stdClass($a);
} }
/**
* Gets the private 'level5' shared service.
*
* @return \stdClass
*/
protected function getLevel5Service()
{
$a = new \Symfony\Component\DependencyInjection\Tests\Fixtures\FooForCircularWithAddCalls();
$this->privates['level5'] = $instance = new \stdClass($a);
$a->call($instance);
return $instance;
}
} }

View File

@ -74,8 +74,8 @@ class Symfony_DI_PhpDumper_Test_Deep_Graph extends Container
if (isset($this->services['foo'])) { if (isset($this->services['foo'])) {
return $this->services['foo']; return $this->services['foo'];
} }
$b = new \stdClass(); $b = new \stdClass();
$c = new \stdClass(); $c = new \stdClass();
$c->p3 = new \stdClass(); $c->p3 = new \stdClass();

View File

@ -290,7 +290,6 @@ class Symfony_DI_PhpDumper_Errored_Definition extends Container
$this->services['foo_with_inline'] = $instance = new \Foo(); $this->services['foo_with_inline'] = $instance = new \Foo();
$a = new \Bar(); $a = new \Bar();
$a->pub = 'pub'; $a->pub = 'pub';
$a->setBaz(($this->services['baz'] ?? $this->getBazService())); $a->setBaz(($this->services['baz'] ?? $this->getBazService()));

View File

@ -54,14 +54,14 @@ class Symfony_DI_PhpDumper_Test_Inline_Self_Ref extends Container
*/ */
protected function getFooService() protected function getFooService()
{ {
$b = new \App\Bar(); $a = new \App\Bar();
$a = new \App\Baz($b);
$this->services['App\Foo'] = $instance = new \App\Foo($a); $b = new \App\Baz($a);
$b->bar = $a;
$b->foo = $instance; $this->services['App\Foo'] = $instance = new \App\Foo($b);
$a->bar = $b; $a->foo = $instance;
return $instance; return $instance;
} }

View File

@ -57,22 +57,20 @@ class ProjectServiceContainer extends Container
{ {
$a = new \TSantos\Serializer\NormalizerRegistry(); $a = new \TSantos\Serializer\NormalizerRegistry();
$d = new \TSantos\Serializer\EventDispatcher\EventDispatcher();
$d->addSubscriber(new \TSantos\SerializerBundle\EventListener\StopwatchListener(new \Symfony\Component\Stopwatch\Stopwatch(true)));
$this->services['tsantos_serializer'] = $instance = new \TSantos\Serializer\EventEmitterSerializer(new \TSantos\Serializer\Encoder\JsonEncoder(), $a, $d);
$b = new \TSantos\Serializer\Normalizer\CollectionNormalizer(); $b = new \TSantos\Serializer\Normalizer\CollectionNormalizer();
$c = new \TSantos\Serializer\EventDispatcher\EventDispatcher();
$c->addSubscriber(new \TSantos\SerializerBundle\EventListener\StopwatchListener(new \Symfony\Component\Stopwatch\Stopwatch(true)));
$this->services['tsantos_serializer'] = $instance = new \TSantos\Serializer\EventEmitterSerializer(new \TSantos\Serializer\Encoder\JsonEncoder(), $a, $c);
$b->setSerializer($instance); $b->setSerializer($instance);
$d = new \TSantos\Serializer\Normalizer\JsonNormalizer();
$c = new \TSantos\Serializer\Normalizer\JsonNormalizer(); $d->setSerializer($instance);
$c->setSerializer($instance);
$a->add(new \TSantos\Serializer\Normalizer\ObjectNormalizer(new \TSantos\SerializerBundle\Serializer\CircularReferenceHandler())); $a->add(new \TSantos\Serializer\Normalizer\ObjectNormalizer(new \TSantos\SerializerBundle\Serializer\CircularReferenceHandler()));
$a->add($b); $a->add($b);
$a->add($c); $a->add($d);
return $instance; return $instance;
} }

View File

@ -34,7 +34,6 @@ class WrappedListener
public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null) public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null)
{ {
$this->listener = $listener; $this->listener = $listener;
$this->name = $name;
$this->stopwatch = $stopwatch; $this->stopwatch = $stopwatch;
$this->dispatcher = $dispatcher; $this->dispatcher = $dispatcher;
$this->called = false; $this->called = false;
@ -44,7 +43,17 @@ class WrappedListener
$this->name = \is_object($listener[0]) ? \get_class($listener[0]) : $listener[0]; $this->name = \is_object($listener[0]) ? \get_class($listener[0]) : $listener[0];
$this->pretty = $this->name.'::'.$listener[1]; $this->pretty = $this->name.'::'.$listener[1];
} elseif ($listener instanceof \Closure) { } elseif ($listener instanceof \Closure) {
$this->pretty = $this->name = 'closure'; $r = new \ReflectionFunction($listener);
if (false !== strpos($r->name, '{closure}')) {
$this->pretty = $this->name = 'closure';
} elseif ($this->name = $r->getClosureScopeClass()) {
$this->pretty = $this->name.'::'.$r->name;
} elseif ($class = $r->getClosureThis()) {
$this->name = \get_class($class);
$this->pretty = $this->name.'::'.$r->name;
} else {
$this->pretty = $this->name = $r->name;
}
} elseif (\is_string($listener)) { } elseif (\is_string($listener)) {
$this->pretty = $this->name = $listener; $this->pretty = $this->name = $listener;
} else { } else {

View File

@ -119,14 +119,14 @@ abstract class AbstractSessionHandler implements \SessionHandlerInterface, \Sess
*/ */
public function destroy($sessionId) public function destroy($sessionId)
{ {
if (!headers_sent() && ini_get('session.use_cookies')) { if (!headers_sent() && filter_var(ini_get('session.use_cookies'), FILTER_VALIDATE_BOOLEAN)) {
if (!$this->sessionName) { if (!$this->sessionName) {
throw new \LogicException(sprintf('Session name cannot be empty, did you forget to call "parent::open()" in "%s"?.', \get_class($this))); throw new \LogicException(sprintf('Session name cannot be empty, did you forget to call "parent::open()" in "%s"?.', \get_class($this)));
} }
$cookie = SessionUtils::popSessionCookie($this->sessionName, $sessionId); $cookie = SessionUtils::popSessionCookie($this->sessionName, $sessionId);
if (null === $cookie) { if (null === $cookie) {
if (\PHP_VERSION_ID < 70300) { if (\PHP_VERSION_ID < 70300) {
setcookie($this->sessionName, '', 0, ini_get('session.cookie_path'), ini_get('session.cookie_domain'), ini_get('session.cookie_secure'), ini_get('session.cookie_httponly')); setcookie($this->sessionName, '', 0, ini_get('session.cookie_path'), ini_get('session.cookie_domain'), filter_var(ini_get('session.cookie_secure'), FILTER_VALIDATE_BOOLEAN), filter_var(ini_get('session.cookie_httponly'), FILTER_VALIDATE_BOOLEAN));
} else { } else {
$params = session_get_cookie_params(); $params = session_get_cookie_params();
unset($params['lifetime']); unset($params['lifetime']);

View File

@ -637,7 +637,7 @@ class PdoSessionHandler extends AbstractSessionHandler
throw new \RuntimeException('Failed to read session: INSERT reported a duplicate id but next SELECT did not return any data.'); throw new \RuntimeException('Failed to read session: INSERT reported a duplicate id but next SELECT did not return any data.');
} }
if (!ini_get('session.use_strict_mode') && self::LOCK_TRANSACTIONAL === $this->lockMode && 'sqlite' !== $this->driver) { if (!filter_var(ini_get('session.use_strict_mode'), FILTER_VALIDATE_BOOLEAN) && self::LOCK_TRANSACTIONAL === $this->lockMode && 'sqlite' !== $this->driver) {
// In strict mode, session fixation is not possible: new sessions always start with a unique // In strict mode, session fixation is not possible: new sessions always start with a unique
// random id, so that concurrency is not possible and this code path can be skipped. // random id, so that concurrency is not possible and this code path can be skipped.
// Exclusive-reading of non-existent rows does not block, so we need to do an insert to block // Exclusive-reading of non-existent rows does not block, so we need to do an insert to block

View File

@ -141,7 +141,7 @@ class NativeSessionStorage implements SessionStorageInterface
throw new \RuntimeException('Failed to start the session: already started by PHP.'); throw new \RuntimeException('Failed to start the session: already started by PHP.');
} }
if (ini_get('session.use_cookies') && headers_sent($file, $line)) { if (filter_var(ini_get('session.use_cookies'), FILTER_VALIDATE_BOOLEAN) && headers_sent($file, $line)) {
throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line)); throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line));
} }

View File

@ -22,7 +22,7 @@ error_reporting(-1);
ini_set('html_errors', 0); ini_set('html_errors', 0);
ini_set('display_errors', 1); ini_set('display_errors', 1);
if (ini_get('xdebug.default_enable')) { if (filter_var(ini_get('xdebug.default_enable'), FILTER_VALIDATE_BOOLEAN)) {
xdebug_disable(); xdebug_disable();
} }

View File

@ -153,7 +153,7 @@ class PdoSessionHandlerTest extends TestCase
public function testReadLockedConvertsStreamToString() public function testReadLockedConvertsStreamToString()
{ {
if (ini_get('session.use_strict_mode')) { if (filter_var(ini_get('session.use_strict_mode'), FILTER_VALIDATE_BOOLEAN)) {
$this->markTestSkipped('Strict mode needs no locking for new sessions.'); $this->markTestSkipped('Strict mode needs no locking for new sessions.');
} }

View File

@ -420,12 +420,27 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
if ($controller instanceof \Closure) { if ($controller instanceof \Closure) {
$r = new \ReflectionFunction($controller); $r = new \ReflectionFunction($controller);
return array( $controller = array(
'class' => $r->getName(), 'class' => $r->getName(),
'method' => null, 'method' => null,
'file' => $r->getFileName(), 'file' => $r->getFileName(),
'line' => $r->getStartLine(), 'line' => $r->getStartLine(),
); );
if (false !== strpos($r->name, '{closure}')) {
return $controller;
}
$controller['method'] = $r->name;
if ($class = $r->getClosureScopeClass()) {
$controller['class'] = $class;
} elseif ($class = $r->getClosureThis()) {
$controller['class'] = \get_class($class);
} else {
return $r->name;
}
return $controller;
} }
if (\is_object($controller)) { if (\is_object($controller)) {

View File

@ -795,7 +795,7 @@ class PropertyAccessor implements PropertyAccessorInterface
} }
$apcu = new ApcuAdapter($namespace, $defaultLifetime / 5, $version); $apcu = new ApcuAdapter($namespace, $defaultLifetime / 5, $version);
if ('cli' === \PHP_SAPI && !ini_get('apc.enable_cli')) { if ('cli' === \PHP_SAPI && !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN)) {
$apcu->setLogger(new NullLogger()); $apcu->setLogger(new NullLogger());
} elseif (null !== $logger) { } elseif (null !== $logger) {
$apcu->setLogger($logger); $apcu->setLogger($logger);

View File

@ -33,15 +33,24 @@ class ReflectionCaster
public static function castClosure(\Closure $c, array $a, Stub $stub, $isNested, $filter = 0) public static function castClosure(\Closure $c, array $a, Stub $stub, $isNested, $filter = 0)
{ {
$prefix = Caster::PREFIX_VIRTUAL;
$c = new \ReflectionFunction($c); $c = new \ReflectionFunction($c);
$a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter); $a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter);
$stub->class .= self::getSignature($a); if (false === strpos($c->name, '{closure}')) {
if (isset($a[$prefix.'class'])) {
$stub->class = $a[$prefix.'class']->value.'::'.$c->name;
} elseif (isset($a[$prefix.'this'])) {
$stub->class = $a[$prefix.'this']->class.'::'.$c->name;
} else {
$stub->class = $c->name;
}
unset($a[$prefix.'class']);
}
unset($a[$prefix.'extra']);
$prefix = Caster::PREFIX_DYNAMIC; $stub->class .= self::getSignature($a);
unset($a['name'], $a[$prefix.'this'], $a[$prefix.'parameter'], $a[Caster::PREFIX_VIRTUAL.'extra']);
$prefix = Caster::PREFIX_VIRTUAL;
if ($filter & Caster::EXCLUDE_VERBOSE) { if ($filter & Caster::EXCLUDE_VERBOSE) {
$stub->cut += ($c->getFileName() ? 2 : 0) + \count($a); $stub->cut += ($c->getFileName() ? 2 : 0) + \count($a);

View File

@ -85,6 +85,34 @@ EOTXT
); );
} }
public function testFromCallableClosureCaster()
{
if (\defined('HHVM_VERSION_ID')) {
$this->markTestSkipped('Not for HHVM.');
}
$var = array(
(new \ReflectionMethod($this, __FUNCTION__))->getClosure($this),
(new \ReflectionMethod(__CLASS__, 'tearDownAfterClass'))->getClosure(),
);
$this->assertDumpMatchesFormat(
<<<EOTXT
array:2 [
0 => Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest::testFromCallableClosureCaster() {
this: Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest { }
file: "%sReflectionCasterTest.php"
line: "%d to %d"
}
1 => %sTestCase::tearDownAfterClass() {
file: "%sTestCase.php"
line: "%d to %d"
}
]
EOTXT
, $var
);
}
public function testClosureCasterExcludingVerbosity() public function testClosureCasterExcludingVerbosity()
{ {
$var = function &($a = 5) {}; $var = function &($a = 5) {};