From a7a5885661001a942b147e3847a17c5d6a80ca0b Mon Sep 17 00:00:00 2001 From: Artem Lopata Date: Wed, 4 Dec 2019 11:31:52 +0100 Subject: [PATCH 01/22] Properly handle phpunit arguments for configuration file --- .../Bridge/PhpUnit/bin/simple-phpunit.php | 46 ++++++++++++++++--- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php index 50873b612aa71..4a8993dc35018 100644 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit.php @@ -24,15 +24,47 @@ static $phpunitConfig = null; if (null === $phpunitConfig) { - $opt = min(array_search('-c', $opts = array_reverse($argv), true) ?: INF, array_search('--configuration', $opts, true) ?: INF); $phpunitConfigFilename = null; - if (INF !== $opt && isset($opts[$opt - 1])) { - $phpunitConfigFilename = $opts[$opt - 1]; - } elseif (file_exists('phpunit.xml')) { - $phpunitConfigFilename = 'phpunit.xml'; - } elseif (file_exists('phpunit.xml.dist')) { - $phpunitConfigFilename = 'phpunit.xml.dist'; + $getPhpUnitConfig = function ($probableConfig) use (&$getPhpUnitConfig) { + if (!$probableConfig) { + return null; + } + if (is_dir($probableConfig)) { + return $getPhpUnitConfig($probableConfig.DIRECTORY_SEPARATOR.'phpunit.xml'); + } + + if (file_exists($probableConfig)) { + return $probableConfig; + } + if (file_exists($probableConfig.'.dist')) { + return $probableConfig.'.dist'; + } + + return null; + }; + + foreach ($argv as $cliArgumentIndex => $cliArgument) { + if ('--' === $cliArgument) { + break; + } + // long option + if ('--configuration' === $cliArgument && array_key_exists($cliArgumentIndex + 1, $argv)) { + $phpunitConfigFilename = $getPhpUnitConfig($argv[$cliArgumentIndex + 1]); + break; + } + // short option + if (0 === strpos($cliArgument, '-c')) { + if ('-c' === $cliArgument && array_key_exists($cliArgumentIndex + 1, $argv)) { + $phpunitConfigFilename = $getPhpUnitConfig($argv[$cliArgumentIndex + 1]); + } else { + $phpunitConfigFilename = $getPhpUnitConfig(substr($cliArgument, 2)); + } + break; + } } + + $phpunitConfigFilename = $phpunitConfigFilename ?: $getPhpUnitConfig('phpunit.xml'); + if ($phpunitConfigFilename) { $phpunitConfig = new DomDocument(); $phpunitConfig->load($phpunitConfigFilename); From ef3bcda5e36572424e6c4f75253d70a3dbd3f3cc Mon Sep 17 00:00:00 2001 From: Craig Duncan Date: Fri, 17 Jan 2020 17:21:39 +0000 Subject: [PATCH 02/22] Mysqli doesn't support the named parameters used by PdoStore --- src/Symfony/Component/Lock/Store/PdoStore.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Component/Lock/Store/PdoStore.php b/src/Symfony/Component/Lock/Store/PdoStore.php index 0cf3dd35f7a19..94ef6b1457027 100644 --- a/src/Symfony/Component/Lock/Store/PdoStore.php +++ b/src/Symfony/Component/Lock/Store/PdoStore.php @@ -307,6 +307,7 @@ private function getDriver(): string } else { switch ($this->driver = $con->getDriver()->getName()) { case 'mysqli': + throw new NotSupportedException(sprintf('The store "%s" does not support the mysqli driver, use pdo_mysql instead.', \get_class($this))); case 'pdo_mysql': case 'drizzle_pdo_mysql': $this->driver = 'mysql'; From a3cc5e50c04030fe3f4a90fc462fe35803977f69 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 21 Jan 2020 13:29:39 +0100 Subject: [PATCH 03/22] updated CHANGELOG for 3.4.37 --- CHANGELOG-3.4.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/CHANGELOG-3.4.md b/CHANGELOG-3.4.md index 91a96c6e3b71c..f68d58c658948 100644 --- a/CHANGELOG-3.4.md +++ b/CHANGELOG-3.4.md @@ -7,6 +7,53 @@ in 3.4 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 between two versions, go to https://github.com/symfony/symfony/compare/v3.4.0...v3.4.1 +* 3.4.37 (2020-01-21) + + * bug #35065 [Security] Use supportsClass in addition to UnsupportedUserException (linaori) + * bug #35343 [Security] Fix RememberMe with null password (jderusse) + * bug #35318 [Yaml] fix PHP const mapping keys using the inline notation (xabbuh) + * bug #35304 [HttpKernel] Fix that no-cache MUST revalidate with the origin (mpdude) + * bug #35299 Avoid `stale-if-error` in FrameworkBundle's HttpCache if kernel.debug = true (mpdude) + * bug #35151 [DI] deferred exceptions in ResolveParameterPlaceHoldersPass (Islam93) + * bug #35254 [PHPUnit-Bridge] Fail-fast in simple-phpunit if one of the passthru() commands fails (mpdude) + * bug #34643 [Dotenv] Fixed infinite loop with missing quote followed by quoted value (naitsirch) + * bug #35239 [Security\Http] Prevent canceled remember-me cookie from being accepted (chalasr) + * bug #35267 [Debug] fix ClassNotFoundFatalErrorHandler (nicolas-grekas) + * bug #35193 [TwigBridge] button_widget now has its title attr translated even if its label = null or false (stephen-lewis) + * bug #35219 [PhpUnitBridge] When using phpenv + phpenv-composer plugin, composer executable is wrapped into a bash script (oleg-andreyev) + * bug #35170 [FrameworkBundle][TranslationUpdateCommand] Do not output positive feedback on stderr (fancyweb) + * bug #35134 [PropertyInfo] Fix BC issue in phpDoc Reflection library (jaapio) + * bug #35125 [Translator] fix performance issue in MessageCatalogue and catalogue operations (ArtemBrovko) + * bug #35103 [Translation] Use `locale_parse` for computing fallback locales (alanpoulain) + * bug #35094 [Console] Fix filtering out identical alternatives when there is a command loader (fancyweb) + * bug #35039 [DI] skip looking for config class when the extension class is anonymous (nicolas-grekas) + * bug #35049 [ProxyManager] fix generating proxies for root-namespaced classes (nicolas-grekas) + * bug #35022 [Dotenv] FIX missing getenv (mccullagh) + * bug #35010 [VarDumper] ignore failing __debugInfo() (nicolas-grekas) + * bug #35000 [Console][SymfonyQuestionHelper] Handle multibytes question choices keys and custom prompt (fancyweb) + * bug #29839 [Validator] fix comparisons with null values at property paths (xabbuh) + * bug #34900 [DoctrineBridge] Fixed submitting invalid ids when using queries with limit (HeahDude) + * bug #34791 [Serializer] Skip uninitialized (PHP 7.4) properties in PropertyNormalizer and ObjectNormalizer (vudaltsov) + * bug #34915 [FrameworkBundle] Fix invalid Windows path normalization in TemplateNameParser (mvorisek) + * bug #34981 stop using deprecated Doctrine persistence classes (xabbuh) + * bug #34904 [Validator][ConstraintValidator] Safe fail on invalid timezones (fancyweb) + * bug #34918 [Translation] fix memoryleak in PhpFileLoader (nicolas-grekas) + * bug #34438 [HttpFoundation] Use `Cache-Control: must-revalidate` only if explicit lifetime has been given (mpdude) + * bug #34449 [Yaml] Implement multiline string as scalar block for tagged values (natepage) + * bug #34601 [MonologBridge] Fix debug processor datetime type (mRoca) + * bug #34842 [ExpressionLanguage] Process division by zero (tigr1991) + * bug #34902 [PropertyAccess] forward caught exception (xabbuh) + * bug #34888 [TwigBundle] add tags before processing them (xabbuh) + * bug #34762 [Config] never try loading failed classes twice with ClassExistenceResource (nicolas-grekas) + * bug #34839 [Cache] fix memory leak when using PhpArrayAdapter (nicolas-grekas) + * bug #34812 [Yaml] fix parsing negative octal numbers (xabbuh) + * bug #34788 [SecurityBundle] Properly escape regex in AddSessionDomainConstraintPass (fancyweb) + * bug #34755 [FrameworkBundle] resolve service locators in `debug:*` commands (nicolas-grekas) + * bug #34832 [Validator] Allow underscore character "_" in URL username and password (romainneutron) + * bug #34738 [SecurityBundle] Passwords are not encoded when algorithm set to "true" (nieuwenhuisen) + * bug #34779 [Security] do not validate passwords when the hash is null (xabbuh) + * bug #34757 [DI] Fix making the container path-independent when the app is in /app (nicolas-grekas) + * 3.4.36 (2019-12-01) * bug #34649 more robust initialization from request (dbu) From c7333d0aa635f6f57eadf99de3446ce409e9882c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 21 Jan 2020 13:29:48 +0100 Subject: [PATCH 04/22] update CONTRIBUTORS for 3.4.37 --- CONTRIBUTORS.md | 125 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 83 insertions(+), 42 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9a6707977b3ec..aea14fb7e6c5d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -16,8 +16,8 @@ Symfony is the result of the work of many people who made the code better - Victor Berchet (victor) - Maxime Steinhausser (ogizanagi) - Ryan Weaver (weaverryan) - - Jakub Zalas (jakubzalas) - Javier Eguiluz (javier.eguiluz) + - Jakub Zalas (jakubzalas) - Roland Franssen (ro0) - Grégoire Pineau (lyrixx) - Johannes S (johannes) @@ -32,16 +32,16 @@ Symfony is the result of the work of many people who made the code better - Joseph Bielawski (stloyd) - Alexander M. Turek (derrabus) - Karma Dordrak (drak) + - Thomas Calvet (fancyweb) - Lukas Kahwe Smith (lsmith) - Martin Hasoň (hason) - Hamza Amrouche (simperfit) - Jeremy Mikola (jmikola) - Jules Pietri (heah) - Jean-François Simon (jfsimon) + - Jérémy DERUSSÉ (jderusse) - Benjamin Eberlei (beberlei) - Igor Wiedler (igorw) - - Jérémy DERUSSÉ (jderusse) - - Thomas Calvet (fancyweb) - Eriksen Costa (eriksencosta) - Guilhem Niot (energetick) - Sarah Khalil (saro0h) @@ -51,13 +51,13 @@ Symfony is the result of the work of many people who made the code better - Diego Saint Esteben (dosten) - Alexandre Salomé (alexandresalome) - William Durand (couac) - - ornicar + - Matthias Pigulla (mpdude) - Pierre du Plessis (pierredup) + - ornicar - Dany Maillard (maidmaid) - Francis Besset (francisbesset) - stealth35 ‏ (stealth35) - Alexander Mols (asm89) - - Matthias Pigulla (mpdude) - Konstantin Myakshin (koc) - Bulat Shakirzyanov (avalanche123) - Valentin Udaltsov (vudaltsov) @@ -81,12 +81,12 @@ Symfony is the result of the work of many people who made the code better - Andrej Hudec (pulzarraider) - Michel Weimerskirch (mweimerskirch) - Issei Murasawa (issei_m) + - Jan Schädlich (jschaedl) - Eric Clemmons (ericclemmons) - Charles Sarrazin (csarrazi) - - Jan Schädlich (jschaedl) - Christian Raue - - Arnout Boks (aboks) - Douglas Greenshields (shieldo) + - Arnout Boks (aboks) - Deni - Henrik Westphal (snc) - Dariusz Górecki (canni) @@ -130,9 +130,9 @@ Symfony is the result of the work of many people who made the code better - Joshua Thijssen - Alex Pott - Daniel Wehner (dawehner) + - Tugdual Saunier (tucksaun) - excelwebzone - Gordon Franke (gimler) - - Tugdual Saunier (tucksaun) - Fabien Pennequin (fabienpennequin) - Théo FIDRY (theofidry) - Eric GELOEN (gelo) @@ -154,6 +154,7 @@ Symfony is the result of the work of many people who made the code better - Daniel Gomes (danielcsgomes) - Hidenori Goto (hidenorigoto) - Andréia Bohner (andreia) + - Yanick Witschi (toflar) - Julien Falque (julienfalque) - Arnaud Kleinpeter (nanocom) - Guilherme Blanco (guilhermeblanco) @@ -168,7 +169,6 @@ Symfony is the result of the work of many people who made the code better - jwdeitch - Mikael Pajunen - Alessandro Chitolina (alekitto) - - Yanick Witschi (toflar) - Niels Keurentjes (curry684) - Vyacheslav Pavlov - Richard van Laak (rvanlaak) @@ -177,8 +177,10 @@ Symfony is the result of the work of many people who made the code better - Vincent Touzet (vincenttouzet) - jeremyFreeAgent (jeremyfreeagent) - Rouven Weßling (realityking) + - Jérôme Parmentier (lctrs) - Clemens Tolboom - Helmer Aaviksoo + - Arman Hosseini (arman) - Hiromi Hishida (77web) - Matthieu Ouellette-Vachon (maoueh) - Michał Pipa (michal.pipa) @@ -190,11 +192,11 @@ Symfony is the result of the work of many people who made the code better - Tyson Andre - GDIBass - Samuel NELA (snela) - - Jérôme Parmentier (lctrs) + - Ben Davies (bendavies) + - Andreas Schempp (aschempp) - James Halsall (jaitsu) - Matthieu Napoli (mnapoli) - Florent Mata (fmata) - - Arman Hosseini - Warnar Boekkooi (boekkooi) - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) @@ -211,7 +213,6 @@ Symfony is the result of the work of many people who made the code better - DQNEO - Andre Rømcke (andrerom) - mcfedr (mcfedr) - - Ben Davies (bendavies) - Gary PEGEOT (gary-p) - Ruben Gonzalez (rubenrua) - Benjamin Dulau (dbenjamin) @@ -221,6 +222,7 @@ Symfony is the result of the work of many people who made the code better - Andreas Hucks (meandmymonkey) - Tom Van Looy (tvlooy) - Noel Guilbert (noel) + - Anthony GRASSIOT (antograssiot) - Stadly - Stepan Anchugov (kix) - bronze1man @@ -243,21 +245,24 @@ Symfony is the result of the work of many people who made the code better - Dustin Whittle (dustinwhittle) - jeff - John Kary (johnkary) - - Andreas Schempp (aschempp) + - Jan Rosier (rosier) - Justin Hileman (bobthecow) - Blanchon Vincent (blanchonvincent) - Michele Orselli (orso) - Sven Paulus (subsven) - Maxime Veber (nek-) - - Anthony GRASSIOT (antograssiot) - Rui Marinho (ruimarinho) - Eugene Wissner + - Edi Modrić (emodric) - Pascal Montoya - Julien Brochet (mewt) - Leo Feyer - Tristan Darricau (nicofuma) - Victor Bocharsky (bocharsky_bw) + - Tomas Norkūnas (norkunas) - Marcel Beerta (mazen) + - Ruud Kamphuis (ruudk) + - Antoine Makdessi (amakdessi) - Maxime Helias (maxhelias) - Pavel Batanov (scaytrase) - Mantis Development @@ -271,6 +276,7 @@ Symfony is the result of the work of many people who made the code better - Lorenz Schori - Sébastien Lavoie (lavoiesl) - Dariusz + - Dmitrii Poddubnyi (karser) - Michael Babker (mbabker) - Francois Zaninotto - Alexander Kotynia (olden) @@ -279,11 +285,13 @@ Symfony is the result of the work of many people who made the code better - Marcos Sánchez - Elnur Abdurrakhimov (elnur) - Manuel Reinhard (sprain) + - Tien Vo (tienvx) - Danny Berger (dpb587) - Antonio J. García Lagar (ajgarlag) - Adam Prager (padam87) - Przemysław Bogusz (przemyslaw-bogusz) - Benoît Burnichon (bburnichon) + - Maciej Malarz (malarzm) - Roman Marintšenko (inori) - Xavier Montaña Carreras (xmontana) - Rémon van de Kamp (rpkamp) @@ -299,14 +307,12 @@ Symfony is the result of the work of many people who made the code better - Jordan Samouh (jordansamouh) - Baptiste Lafontaine (magnetik) - Jakub Kucharovic (jkucharovic) - - Edi Modrić (emodric) - Uwe Jäger (uwej711) - Eugene Leonovich (rybakit) - Filippo Tessarotto - Joseph Rouff (rouffj) - Félix Labrecque (woodspire) - GordonsLondon - - Tomas Norkūnas (norkunas) - Quynh Xuan Nguyen (xuanquynh) - Jan Sorgalla (jsor) - Ray @@ -314,7 +320,6 @@ Symfony is the result of the work of many people who made the code better - Chekote - François Pluchino (francoispluchino) - Christopher Hertel (chertel) - - Antoine Makdessi (amakdessi) - Thomas Adam - Jhonny Lidfors (jhonne) - Diego Agulló (aeoris) @@ -335,7 +340,6 @@ Symfony is the result of the work of many people who made the code better - Zan Baldwin (zanderbaldwin) - Roumen Damianoff (roumen) - Kim Hemsø Rasmussen (kimhemsoe) - - Dmitrii Poddubnyi (karser) - Pascal Luna (skalpa) - Wouter Van Hecke - Peter Kruithof (pkruithof) @@ -348,6 +352,7 @@ Symfony is the result of the work of many people who made the code better - Christian Schmidt - Patrick Landolt (scube) - MatTheCat + - Loick Piera (pyrech) - David Badura (davidbadura) - Chad Sikorra (chadsikorra) - Chris Smith (cs278) @@ -368,7 +373,6 @@ Symfony is the result of the work of many people who made the code better - Jerzy Zawadzki (jzawadzki) - Wouter J - Ismael Ambrosi (iambrosi) - - Ruud Kamphuis (ruudk) - Emmanuel BORGES (eborges78) - Aurelijus Valeiša (aurelijus) - Jan Decavele (jandc) @@ -390,6 +394,7 @@ Symfony is the result of the work of many people who made the code better - Thierry Thuon (lepiaf) - Ricard Clau (ricardclau) - Mark Challoner (markchalloner) + - Philippe Segatori - Gennady Telegin (gtelegin) - Erin Millard - Artur Melo (restless) @@ -398,12 +403,12 @@ Symfony is the result of the work of many people who made the code better - Thomas Royer (cydonia7) - Nicolas LEFEVRE (nicoweb) - alquerci + - Olivier Dolbeau (odolbeau) - Mateusz Sip (mateusz_sip) - Francesco Levorato - Vitaliy Zakharov (zakharovvi) - Tobias Sjösten (tobiassjosten) - Gyula Sallai (salla) - - Maciej Malarz (malarzm) - Inal DJAFAR (inalgnu) - Christian Gärtner (dagardner) - Dmytro Borysovskyi (dmytr0) @@ -415,13 +420,14 @@ Symfony is the result of the work of many people who made the code better - Felix Labrecque - Yaroslav Kiliba - Terje Bråten - - Tien Vo (tienvx) - Robbert Klarenbeek (robbertkl) - Eric Masoero (eric-masoero) - JhonnyL - hossein zolfi (ocean) - Clément Gautier (clementgautier) + - Bastien Jaillot (bastnic) - Dāvis Zālītis (k0d3r1s) + - Emanuele Panzeri (thepanz) - Sanpi - Eduardo Gulias (egulias) - giulio de donato (liuggio) @@ -437,6 +443,7 @@ Symfony is the result of the work of many people who made the code better - Alex Bowers - Philipp Cordes - Costin Bereveanu (schniper) + - Vilius Grigaliūnas - Loïc Chardonnet (gnusat) - Marek Kalnik (marekkalnik) - Vyacheslav Salakhutdinov (megazoll) @@ -446,9 +453,11 @@ Symfony is the result of the work of many people who made the code better - Michele Locati - Pavel Volokitin (pvolok) - Valentine Boineau (valentineboineau) + - Benjamin Leveque (benji07) - Arthur de Moulins (4rthem) - Matthias Althaus (althaus) - Nicolas Dewez (nicolas_dewez) + - Saif Eddin G - Endre Fejes - Tobias Naumann (tna) - Daniel Beyer @@ -461,7 +470,6 @@ Symfony is the result of the work of many people who made the code better - Lee Rowlands - Krzysztof Piasecki (krzysztek) - Maximilian Reichel (phramz) - - Loick Piera (pyrech) - Alain Hippolyte (aloneh) - Grenier Kévin (mcsky_biig) - Karoly Negyesi (chx) @@ -484,6 +492,7 @@ Symfony is the result of the work of many people who made the code better - Sébastien Santoro (dereckson) - Brian King - Michel Salib (michelsalib) + - Chris Tanaskoski - geoffrey - Steffen Roßkamp - Alexandru Furculita (afurculita) @@ -494,6 +503,7 @@ Symfony is the result of the work of many people who made the code better - Christopher Davis (chrisguitarguy) - Webnet team (webnet) - Farhad Safarov + - Jeroen Spee (jeroens) - Jan Schumann - Niklas Fiekas - Markus Bachmann (baachi) @@ -502,8 +512,7 @@ Symfony is the result of the work of many people who made the code better - Mihai Stancu - Ivan Nikolaev (destillat) - Gildas Quéméner (gquemener) - - Olivier Dolbeau (odolbeau) - - Jan Rosier (rosier) + - Oleg Andreyev - Alessandro Lai (jean85) - Desjardins Jérôme (jewome62) - Arturs Vonda @@ -543,7 +552,7 @@ Symfony is the result of the work of many people who made the code better - Gintautas Miselis - Rob Bast - Roberto Espinoza (respinoza) - - Emanuele Panzeri (thepanz) + - Alan Poulain - Soufian EZ-ZANTAR (soezz) - Zander Baldwin - Gocha Ossinkine (ossinkine) @@ -602,7 +611,6 @@ Symfony is the result of the work of many people who made the code better - Jakub Škvára (jskvara) - Andrew Udvare (audvare) - alexpods - - Saif Eddin G - Johann Pardanaud - Adam Szaraniec (mimol) - Dariusz Ruminski @@ -620,7 +628,6 @@ Symfony is the result of the work of many people who made the code better - Nils Adermann (naderman) - Gábor Fási - DUPUCH (bdupuch) - - Benjamin Leveque (benji07) - Nate (frickenate) - Timothée Barray (tyx) - jhonnyL @@ -661,20 +668,22 @@ Symfony is the result of the work of many people who made the code better - Disquedur - Michiel Boeckaert (milio) - Geoffrey Tran (geoff) + - Pablo Lozano (arkadis) - Kyle - Jan Behrens - Mantas Var (mvar) - - Chris Tanaskoski - Terje Bråten - Sebastian Krebs - Piotr Stankowski - Baptiste Leduc (bleduc) - Julien Maulny + - Sebastien Morel (plopix) - Jean-Christophe Cuvelier [Artack] - Julien Montel (julienmgel) - - Philippe Segatori - Simon DELICATA + - Artem Henvald (artemgenvald) - Dmitry Simushev + - Joe Bennett (kralos) - alcaeus - Fred Cox - vitaliytv @@ -690,7 +699,6 @@ Symfony is the result of the work of many people who made the code better - Kyle Evans (kevans91) - Charles-Henri Bruyand - Max Rath (drak3) - - Oleg Andreyev - Stéphane Escandell (sescandell) - Konstantin S. M. Möllers (ksmmoellers) - James Johnston @@ -754,6 +762,7 @@ Symfony is the result of the work of many people who made the code better - M. Vondano - Quentin de Longraye (quentinus95) - Chris Heng (gigablah) + - Islam93 - Shaun Simmons (simshaun) - Richard Bradley - Ulumuddin Yunus (joenoez) @@ -766,6 +775,7 @@ Symfony is the result of the work of many people who made the code better - Antoine Corcy - Ahmed Ashraf (ahmedash95) - Sascha Grossenbacher + - Alexander Menshchikov (zmey_kk) - Szijarto Tamas - Robin Lehrmann (robinlehrmann) - Catalin Dan @@ -818,7 +828,6 @@ Symfony is the result of the work of many people who made the code better - Michael Piecko - Toni Peric (tperic) - yclian - - Alan Poulain - Aleksey Prilipko - Andrew Berry - twifty @@ -830,11 +839,11 @@ Symfony is the result of the work of many people who made the code better - Dominik Ritter (dritter) - Dimitri Gritsajuk (ottaviano) - Sebastian Grodzicki (sgrodzicki) + - Mohamed Gamal - Jeroen van den Enden (stoefke) - Pascal Helfenstein - Baldur Rensch (brensch) - Pierre Rineau - - Vilius Grigaliūnas - Vladyslav Petrovych - Alex Xandra Albert Sim - Carson Full @@ -843,6 +852,7 @@ Symfony is the result of the work of many people who made the code better - Yuen-Chi Lian - Tarjei Huse (tarjei) - Besnik Br + - Toni Rudolf (toooni) - Jose Gonzalez - Jonathan (jls-esokia) - Oleksii Zhurbytskyi @@ -851,6 +861,7 @@ Symfony is the result of the work of many people who made the code better - Claudio Zizza - Dave Marshall (davedevelopment) - Jakub Kulhan (jakubkulhan) + - Shaharia Azam - avorobiev - Grégoire Penverne (gpenverne) - Venu @@ -896,6 +907,7 @@ Symfony is the result of the work of many people who made the code better - Franco Traversaro (belinde) - Francis Turmel (fturmel) - Nikita Nefedov (nikita2206) + - Alex Bacart - cgonzalez - Ben - Vincent Composieux (eko) @@ -919,6 +931,7 @@ Symfony is the result of the work of many people who made the code better - Reen Lokum - Andreas Möller (localheinz) - Martin Parsiegla (spea) + - Ivan - Quentin Schuler - Pierre Vanliefland (pvanliefland) - Roy Klutman (royklutman) @@ -969,6 +982,7 @@ Symfony is the result of the work of many people who made the code better - Derek ROTH - Ben Johnson - mweimerskirch + - Lctrs - Dmytro Boiko (eagle) - Shin Ohno (ganchiku) - Geert De Deckere (geertdd) @@ -1009,6 +1023,7 @@ Symfony is the result of the work of many people who made the code better - Marcos Gómez Vilches (markitosgv) - Matthew Davis (mdavis1982) - Markus S. (staabm) + - Guilliam Xavier - Maks - Antoine LA - den @@ -1030,14 +1045,12 @@ Symfony is the result of the work of many people who made the code better - Benoît Merlet (trompette) - Koen Kuipers - datibbaw - - Pablo Lozano (arkadis) - Erik Saunier (snickers) - Rootie - Daniel Alejandro Castro Arellano (lexcast) - sensio - Thomas Jarrand - Antoine Bluchet (soyuka) - - Sebastien Morel (plopix) - Patrick Kaufmann - Anton Dyshkant - Reece Fowell (reecefowell) @@ -1152,6 +1165,7 @@ Symfony is the result of the work of many people who made the code better - AKeeman (akeeman) - Mert Simsek (mrtsmsk0) - Lin Clark + - Meneses (c77men) - Jeremy David (jeremy.david) - Jordi Rejas - Troy McCabe @@ -1185,6 +1199,7 @@ Symfony is the result of the work of many people who made the code better - HypeMC - jfcixmedia - Dominic Tubach + - Nicolas Philippe (nikophil) - Nikita Konstantinov - Martijn Evers - Vitaliy Ryaboy (vitaliy) @@ -1241,7 +1256,9 @@ Symfony is the result of the work of many people who made the code better - e-ivanov - Michał (bambucha15) - Einenlum + - Jérémy Jarrié (gagnar) - Jochen Bayer (jocl) + - Michel Roca (mroca) - Patrick Carlo-Hickman - Bruno MATEU - Jeremy Bush @@ -1274,14 +1291,17 @@ Symfony is the result of the work of many people who made the code better - rchoquet - gitlost - Taras Girnyk + - Rémi Leclerc - Jan Vernarsky - Amine Yakoubi - Eduardo García Sanz (coma) - Sergio (deverad) - James Gilliland - fduch (fduch) + - Stuart Fyfe - David de Boer (ddeboer) - Eno Mullaraj (emullaraj) + - Nathan PAGE (nathix) - Ryan Rogers - Klaus Purer - arnaud (arnooo999) @@ -1404,6 +1424,7 @@ Symfony is the result of the work of many people who made the code better - Walter Dal Mut (wdalmut) - abluchet - Ruud Arentsen + - Ahmed Raafat - Harald Tollefsen - Matthieu - Albin Kerouaton @@ -1431,6 +1452,7 @@ Symfony is the result of the work of many people who made the code better - Constantine Shtompel - Jules Lamur - Renato Mendes Figueiredo + - Benjamin RICHARD - pdommelen - Eric Stern - ShiraNai7 @@ -1453,8 +1475,9 @@ Symfony is the result of the work of many people who made the code better - m.chwedziak - Andreas Frömer - Philip Frank + - David Brooks - Lance McNearney - - Jeroen Spee (jeroens) + - Guillaume Verstraete - Giorgio Premi - ncou - Ian Carroll @@ -1466,7 +1489,6 @@ Symfony is the result of the work of many people who made the code better - Tom Corrigan (tomcorrigan) - Luis Galeas - Martin Pärtel - - Bastien Jaillot (bastnic) - Daniel Rotter (danrot) - Frédéric Bouchery (fbouchery) - Patrick Daley (padrig) @@ -1475,7 +1497,6 @@ Symfony is the result of the work of many people who made the code better - WedgeSama - Felds Liscia - Chihiro Adachi (chihiro-adachi) - - Alex Bacart - Raphaëll Roussel - Tadcka - Beth Binkovitz @@ -1504,6 +1525,7 @@ Symfony is the result of the work of many people who made the code better - Mathieu Morlon - Daniel Tschinder - Arnaud CHASSEUX + - tuqqu - Wojciech Gorczyca - Rafał Muszyński (rafmus90) - Sébastien Decrême (sebdec) @@ -1563,8 +1585,10 @@ Symfony is the result of the work of many people who made the code better - Patrik Gmitter (patie) - Peter Schultz - Jonathan Gough + - Benhssaein Youssef - Benjamin Bender - Jared Farrish + - Trevor North - karl.rixon - raplider - Konrad Mohrfeldt @@ -1636,6 +1660,7 @@ Symfony is the result of the work of many people who made the code better - Francisco Facioni (fran6co) - Stanislav Gamayunov (happyproff) - Iwan van Staveren (istaveren) + - Alexander McCullagh (mccullagh) - Povilas S. (povilas) - Laurent Negre (raulnet) - Evrard Boulou @@ -1772,6 +1797,7 @@ Symfony is the result of the work of many people who made the code better - JakeFr - Simon Sargeant - efeen + - Jan Christoph Beyer - Nicolas Pion - Muhammed Akbulut - Roy-Orbison @@ -1785,6 +1811,7 @@ Symfony is the result of the work of many people who made the code better - Johannes Müller (johmue) - Jordi Llonch (jordillonch) - Nicholas Ruunu (nicholasruunu) + - Jeroen van den Nieuwenhuisen (nieuwenhuisen) - Cyril Pascal (paxal) - Cédric Dugat (ph3nol) - Philip Dahlstrøm (phidah) @@ -1825,10 +1852,10 @@ Symfony is the result of the work of many people who made the code better - Dmitry Korotovsky - mcorteel - Michael van Tricht - - Ivan - ReScO - Tim Strehle - Sam Ward + - Michael Voříšek - Walther Lalk - Adam - Ivo @@ -1840,7 +1867,6 @@ Symfony is the result of the work of many people who made the code better - gedrox - Bohan Yang - Alan Bondarchuk - - Joe Bennett - dropfen - Andrey Chernykh - Edvinas Klovas @@ -1858,6 +1884,7 @@ Symfony is the result of the work of many people who made the code better - thib92 - Rudolf Ratusiński - Bertalan Attila + - Rafael Tovar - Amin Hosseini (aminh) - AmsTaFF (amstaff) - Simon Müller (boscho) @@ -1872,10 +1899,13 @@ Symfony is the result of the work of many people who made the code better - Jan Marek (janmarek) - Mark de Haan (markdehaan) - Dan Patrick (mdpatrick) + - naitsirch (naitsirch) - Geoffrey Monte (numerogeek) + - Martijn Boers (plebian) - Pedro Magalhães (pmmaga) - Rares Vlaseanu (raresvla) - tante kinast (tante) + - Stephen Lewis (tehanomalousone) - Ahmed Hannachi (tiecoders) - Vincent LEFORT (vlefort) - Walid BOUGHDIRI (walidboughdiri) @@ -1982,7 +2012,6 @@ Symfony is the result of the work of many people who made the code better - Klaas Naaijkens - Daniel González Cerviño - Rafał - - Lctrs - Achilles Kaloeridis (achilles) - Adria Lopez (adlpz) - Aaron Scherer (aequasi) @@ -1993,8 +2022,10 @@ Symfony is the result of the work of many people who made the code better - Masao Maeda (brtriver) - Darius Leskauskas (darles) - david perez (davidpv) + - Daniël Brekelmans (dbrekelmans) - David Joos (djoos) - Denis Klementjev (dklementjev) + - Dominik Pesch (dombn) - Dominik Hajduk (dominikalp) - Tomáš Polívka (draczris) - Dennis Smink (dsmink) @@ -2005,6 +2036,7 @@ Symfony is the result of the work of many people who made the code better - Gusakov Nikita (hell0w0rd) - Yannick Ihmels (ihmels) - Osman Üngür (import) + - Jaap van Otterdijk (jaapio) - Javier Núñez Berrocoso (javiernuber) - Jelle Bekker (jbekker) - Giovanni Albero (johntree) @@ -2021,6 +2053,7 @@ Symfony is the result of the work of many people who made the code better - Marek Šimeček (mssimi) - Dmitriy Tkachenko (neka) - Cayetano Soriano Gallego (neoshadybeat) + - Artem (nexim) - Olivier Laviale (olvlvl) - Ondrej Machulda (ondram) - Pierre Gasté (pierre_g) @@ -2036,6 +2069,7 @@ Symfony is the result of the work of many people who made the code better - Angel Fernando Quiroz Campos - Ondrej Mirtes - akimsko + - Stefan Kruppa - Youpie - srsbiz - Taylan Kasap @@ -2075,6 +2109,7 @@ Symfony is the result of the work of many people who made the code better - Till Klampaeckel (till) - Tobias Weinert (tweini) - Ulf Reimers (ureimers) + - Morten Wulff (wulff) - Wotre - goohib - Tom Counsell @@ -2095,7 +2130,6 @@ Symfony is the result of the work of many people who made the code better - Benjamin Morel - Eric Grimois - Piers Warmers - - Guilliam Xavier - Sylvain Lorinet - klyk50 - Andreas Lutro @@ -2235,10 +2269,12 @@ Symfony is the result of the work of many people who made the code better - Oussama Elgoumri - Dawid Nowak - Lesnykh Ilia + - sabruss - darnel - Karolis Daužickas - Nicolas - Sergio Santoro + - Dmitriy Derepko - tirnanog06 - phc - Дмитрий Пацура @@ -2283,6 +2319,7 @@ Symfony is the result of the work of many people who made the code better - Carsten Eilers (fnc) - Sorin Gitlan (forapathy) - Yohan Giarelli (frequence-web) + - Jesse Rushlow (geeshoe) - Gerry Vandermaesen (gerryvdm) - Ghazy Ben Ahmed (ghazy) - Arash Tabriziyan (ghost098) @@ -2317,6 +2354,7 @@ Symfony is the result of the work of many people who made the code better - Michal Čihař (mcihar) - Matt Drollette (mdrollette) - Adam Monsen (meonkeys) + - diego aguiar (mollokhan) - Hugo Monteiro (monteiro) - Ala Eddine Khefifi (nayzo) - emilienbouard (neime) @@ -2332,6 +2370,7 @@ Symfony is the result of the work of many people who made the code better - Philipp Hoffmann (philipphoffmann) - Alex Carol (picard89) - Daniel Perez Pinazo (pitiflautico) + - Igor Tarasov (polosatus) - Phil Taylor (prazgod) - Maxim Pustynnikov (pustynnikov) - Ralf Kuehnel (ralfkuehnel) @@ -2365,7 +2404,6 @@ Symfony is the result of the work of many people who made the code better - Wouter Sioen (wouter_sioen) - Xavier Amado (xamado) - Jesper Søndergaard Pedersen (zerrvox) - - Alexander Menshchikov (zmey_kk) - Florent Cailhol - szymek - Ryan Linnit @@ -2377,6 +2415,7 @@ Symfony is the result of the work of many people who made the code better - MaPePeR - Andreas Streichardt - Alexandre Segura + - Vivien - Pascal Hofmann - david-binda - smokeybear87 @@ -2389,6 +2428,7 @@ Symfony is the result of the work of many people who made the code better - Sergey Fedotov - Konstantin Scheumann - Michael + - Nate Wiebe - fh-github@fholzhauer.de - AbdElKader Bouadjadja - DSeemiller @@ -2400,6 +2440,7 @@ Symfony is the result of the work of many people who made the code better - max - Alexander Bauer (abauer) - Ahmad Mayahi (ahmadmayahi) + - Alireza Mirsepassi (alirezamirsepassi) - Mohamed Karnichi (amiral) - Andrew Carter (andrewcarteruk) - Adam Elsodaney (archfizz) From 10663730ae2608ebb3ce712e2f738b1128026a5e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 21 Jan 2020 13:29:51 +0100 Subject: [PATCH 05/22] updated VERSION for 3.4.37 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 4f5a8da7fe7c8..463b49174fbf3 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -67,12 +67,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '3.4.37-DEV'; + const VERSION = '3.4.37'; const VERSION_ID = 30437; const MAJOR_VERSION = 3; const MINOR_VERSION = 4; const RELEASE_VERSION = 37; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2020'; const END_OF_LIFE = '11/2021'; From 6aec78035115e6459cd10147368e6c4c59596c39 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 21 Jan 2020 14:12:52 +0100 Subject: [PATCH 06/22] bumped Symfony version to 3.4.38 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 463b49174fbf3..87f102a0fb26d 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -67,12 +67,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '3.4.37'; - const VERSION_ID = 30437; + const VERSION = '3.4.38-DEV'; + const VERSION_ID = 30438; const MAJOR_VERSION = 3; const MINOR_VERSION = 4; - const RELEASE_VERSION = 37; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 38; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2020'; const END_OF_LIFE = '11/2021'; From f2cf444fb0f5d3bc0dc16af02ce51520ab246a4c Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 21 Jan 2020 14:21:51 +0100 Subject: [PATCH 07/22] bumped Symfony version to 4.3.11 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 9c31bbbd3f8d3..c91a5cbacfa74 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -73,12 +73,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.3.10'; - const VERSION_ID = 40310; + const VERSION = '4.3.11-DEV'; + const VERSION_ID = 40311; const MAJOR_VERSION = 4; const MINOR_VERSION = 3; - const RELEASE_VERSION = 10; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 11; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '01/2020'; const END_OF_LIFE = '07/2020'; From 09818e99ac6854950a8bc7abc0f2c839990a60bd Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 22 Jan 2020 08:15:02 +0100 Subject: [PATCH 08/22] [Cache] fix checking for igbinary availability --- .travis.yml | 2 +- .../Component/Cache/Marshaller/DefaultMarshaller.php | 8 ++++---- .../Cache/Tests/Marshaller/DefaultMarshallerTest.php | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 54171b24066de..3a5c1a92ccee7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -172,7 +172,7 @@ before_install: tfold ext.apcu tpecl apcu-5.1.17 apcu.so $INI tfold ext.mongodb tpecl mongodb-1.6.0alpha1 mongodb.so $INI - tfold ext.igbinary tpecl igbinary-2.0.8 igbinary.so $INI + tfold ext.igbinary tpecl igbinary-3.1.2 igbinary.so $INI tfold ext.zookeeper tpecl zookeeper-0.7.1 zookeeper.so $INI tfold ext.amqp tpecl amqp-1.9.4 amqp.so $INI tfold ext.redis tpecl redis-4.3.0 redis.so $INI "no" diff --git a/src/Symfony/Component/Cache/Marshaller/DefaultMarshaller.php b/src/Symfony/Component/Cache/Marshaller/DefaultMarshaller.php index 8056090110c41..f4cad03fe18f1 100644 --- a/src/Symfony/Component/Cache/Marshaller/DefaultMarshaller.php +++ b/src/Symfony/Component/Cache/Marshaller/DefaultMarshaller.php @@ -25,9 +25,9 @@ class DefaultMarshaller implements MarshallerInterface public function __construct(bool $useIgbinarySerialize = null) { if (null === $useIgbinarySerialize) { - $useIgbinarySerialize = \extension_loaded('igbinary') && \PHP_VERSION_ID < 70400; - } elseif ($useIgbinarySerialize && (!\extension_loaded('igbinary') || \PHP_VERSION_ID >= 70400)) { - throw new CacheException('The "igbinary" PHP extension is not '.(\PHP_VERSION_ID >= 70400 ? 'compatible with PHP 7.4.' : 'loaded.')); + $useIgbinarySerialize = \extension_loaded('igbinary') && (\PHP_VERSION_ID < 70400 || version_compare('3.1.0', phpversion('igbinary'), '<=')); + } elseif ($useIgbinarySerialize && (!\extension_loaded('igbinary') || (\PHP_VERSION_ID >= 70400 && version_compare('3.1.0', phpversion('igbinary'), '>')))) { + throw new CacheException(\extension_loaded('igbinary') && \PHP_VERSION_ID >= 70400 ? 'Please upgrade the "igbinary" PHP extension to v3.1 or higher.' : 'The "igbinary" PHP extension is not loaded.'); } $this->useIgbinarySerialize = $useIgbinarySerialize; } @@ -66,7 +66,7 @@ public function unmarshall(string $value) return null; } static $igbinaryNull; - if ($value === ($igbinaryNull ?? $igbinaryNull = \extension_loaded('igbinary') && \PHP_VERSION_ID < 70400 ? igbinary_serialize(null) : false)) { + if ($value === ($igbinaryNull ?? $igbinaryNull = \extension_loaded('igbinary') && (\PHP_VERSION_ID < 70400 || version_compare('3.1.0', phpversion('igbinary'), '<=')) ? igbinary_serialize(null) : false)) { return null; } $unserializeCallbackHandler = ini_set('unserialize_callback_func', __CLASS__.'::handleUnserializeCallback'); diff --git a/src/Symfony/Component/Cache/Tests/Marshaller/DefaultMarshallerTest.php b/src/Symfony/Component/Cache/Tests/Marshaller/DefaultMarshallerTest.php index cc94ad15237a0..aaef04610e457 100644 --- a/src/Symfony/Component/Cache/Tests/Marshaller/DefaultMarshallerTest.php +++ b/src/Symfony/Component/Cache/Tests/Marshaller/DefaultMarshallerTest.php @@ -24,7 +24,7 @@ public function testSerialize() 'b' => function () {}, ]; - $expected = ['a' => \extension_loaded('igbinary') && \PHP_VERSION_ID < 70400 ? igbinary_serialize(123) : serialize(123)]; + $expected = ['a' => \extension_loaded('igbinary') && (\PHP_VERSION_ID < 70400 || version_compare('3.1.0', phpversion('igbinary'), '<=')) ? igbinary_serialize(123) : serialize(123)]; $this->assertSame($expected, $marshaller->marshall($values, $failed)); $this->assertSame(['b'], $failed); } @@ -43,7 +43,7 @@ public function testNativeUnserialize() */ public function testIgbinaryUnserialize() { - if (\PHP_VERSION_ID >= 70400) { + if (\PHP_VERSION_ID >= 70400 && version_compare('3.1.0', phpversion('igbinary'), '>')) { $this->markTestSkipped('igbinary is not compatible with PHP 7.4.'); } @@ -67,7 +67,7 @@ public function testNativeUnserializeNotFoundClass() */ public function testIgbinaryUnserializeNotFoundClass() { - if (\PHP_VERSION_ID >= 70400) { + if (\PHP_VERSION_ID >= 70400 && version_compare('3.1.0', phpversion('igbinary'), '>')) { $this->markTestSkipped('igbinary is not compatible with PHP 7.4.'); } @@ -95,7 +95,7 @@ public function testNativeUnserializeInvalid() */ public function testIgbinaryUnserializeInvalid() { - if (\PHP_VERSION_ID >= 70400) { + if (\PHP_VERSION_ID >= 70400 && version_compare('3.1.0', phpversion('igbinary'), '>')) { $this->markTestSkipped('igbinary is not compatible with PHP 7.4.'); } From 3918f23307f60339a1644ca23ad25600eb5aff8e Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Wed, 22 Jan 2020 10:20:58 +0100 Subject: [PATCH 09/22] Minor Travis cosmetic patch --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b1f4265d25f82..dc83df3ef960f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -179,7 +179,7 @@ before_install: done - | # List all php extensions with versions - - php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . " " . phpversion($extension) . PHP_EOL;' + php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . " " . phpversion($extension) . PHP_EOL;' - | # Load fixtures From 28cd964ac9490e9817ede736bb9c582fa19c69cb Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 23 Jan 2020 11:22:20 +0100 Subject: [PATCH 10/22] Fix testing with mongodb --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8574ad92a0f98..4251d2fa0247c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -182,7 +182,7 @@ before_install: echo extension = $ext_cache >> $INI elif [[ $PHP = 7.* ]]; then tfold ext.apcu tpecl apcu-5.1.17 apcu.so $INI - tfold ext.mongodb tpecl mongodb-1.6.0alpha1 mongodb.so $INI + tfold ext.mongodb tpecl mongodb-1.6.0 mongodb.so $INI fi done @@ -279,7 +279,7 @@ install: fi phpenv global ${PHP/hhvm*/hhvm} if [[ $PHP = 7.* ]]; then - ([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.6.0; composer require --dev --no-update mongodb/mongodb) + ([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.6.0; composer require --dev --no-update mongodb/mongodb ~1.5.0) fi tfold 'composer update' $COMPOSER_UP if [[ $TRAVIS_PHP_VERSION = 5.* || $TRAVIS_PHP_VERSION = hhvm* ]]; then From 0d47fdfb4921fcfa43c71221ad7266fe2e8ddfb7 Mon Sep 17 00:00:00 2001 From: Guilliam Xavier Date: Mon, 20 Jan 2020 10:07:41 +0100 Subject: [PATCH 11/22] [DoctrineBridge] [DX] Improve condition for exception text in ManagerRegistry to avoid confusion --- src/Symfony/Bridge/Doctrine/ManagerRegistry.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Doctrine/ManagerRegistry.php b/src/Symfony/Bridge/Doctrine/ManagerRegistry.php index a19be6a0c4071..b6e7f19df27ae 100644 --- a/src/Symfony/Bridge/Doctrine/ManagerRegistry.php +++ b/src/Symfony/Bridge/Doctrine/ManagerRegistry.php @@ -13,6 +13,7 @@ use Doctrine\Persistence\AbstractManagerRegistry; use ProxyManager\Proxy\LazyLoadingInterface; +use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator; use Symfony\Component\DependencyInjection\Container; /** @@ -46,7 +47,7 @@ protected function resetService($name) $manager = $this->container->get($name); if (!$manager instanceof LazyLoadingInterface) { - throw new \LogicException('Resetting a non-lazy manager service is not supported. '.(interface_exists(LazyLoadingInterface::class) ? sprintf('Declare the "%s" service as lazy.', $name) : 'Try running "composer require symfony/proxy-manager-bridge".')); + throw new \LogicException('Resetting a non-lazy manager service is not supported. '.(interface_exists(LazyLoadingInterface::class) && class_exists(RuntimeInstantiator::class) ? sprintf('Declare the "%s" service as lazy.', $name) : 'Try running "composer require symfony/proxy-manager-bridge".')); } $manager->setProxyInitializer(\Closure::bind( function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) { From dd94b386a9a282cfd6184768303b2d83cdfd485b Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 25 Jan 2020 13:32:28 +0100 Subject: [PATCH 12/22] Fix displaying anonymous classes on PHP >= 7.4.2 --- src/Symfony/Component/Console/Application.php | 2 +- src/Symfony/Component/Debug/Exception/FlattenException.php | 2 +- src/Symfony/Component/VarDumper/Caster/ClassStub.php | 2 +- src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index e9d80d76d9be1..d23871f5acfbd 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -796,7 +796,7 @@ protected function doRenderException(\Exception $e, OutputInterface $output) } if (false !== strpos($message, "class@anonymous\0")) { - $message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) { + $message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0]; }, $message); } diff --git a/src/Symfony/Component/Debug/Exception/FlattenException.php b/src/Symfony/Component/Debug/Exception/FlattenException.php index 71dc4febfc9c0..5dbf64db80912 100644 --- a/src/Symfony/Component/Debug/Exception/FlattenException.php +++ b/src/Symfony/Component/Debug/Exception/FlattenException.php @@ -172,7 +172,7 @@ public function getMessage() public function setMessage($message) { if (false !== strpos($message, "class@anonymous\0")) { - $message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) { + $message = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0]; }, $message); } diff --git a/src/Symfony/Component/VarDumper/Caster/ClassStub.php b/src/Symfony/Component/VarDumper/Caster/ClassStub.php index afafda57530bc..60ecb99769a37 100644 --- a/src/Symfony/Component/VarDumper/Caster/ClassStub.php +++ b/src/Symfony/Component/VarDumper/Caster/ClassStub.php @@ -56,7 +56,7 @@ public function __construct(string $identifier, $callable = null) } if (false !== strpos($identifier, "class@anonymous\0")) { - $this->value = $identifier = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) { + $this->value = $identifier = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0]; }, $identifier); } diff --git a/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php b/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php index ad02aec2fe3b6..542472ebaf138 100644 --- a/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php +++ b/src/Symfony/Component/VarDumper/Caster/ExceptionCaster.php @@ -282,7 +282,7 @@ private static function filterExceptionArray($xClass, array $a, $xPrefix, $filte unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']); if (isset($a[Caster::PREFIX_PROTECTED.'message']) && false !== strpos($a[Caster::PREFIX_PROTECTED.'message'], "class@anonymous\0")) { - $a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:)[0-9a-fA-F]++/', function ($m) { + $a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0]; }, $a[Caster::PREFIX_PROTECTED.'message']); } From a7864489b026535f6f07dd31566e9c0732852e2e Mon Sep 17 00:00:00 2001 From: Craig Duncan Date: Sat, 25 Jan 2020 13:06:31 +0000 Subject: [PATCH 13/22] Mysqli doesn't support the named parameters used by PdoAdapter --- src/Symfony/Component/Cache/Traits/PdoTrait.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Symfony/Component/Cache/Traits/PdoTrait.php b/src/Symfony/Component/Cache/Traits/PdoTrait.php index b636e7565b2cd..3294f1fe50d66 100644 --- a/src/Symfony/Component/Cache/Traits/PdoTrait.php +++ b/src/Symfony/Component/Cache/Traits/PdoTrait.php @@ -395,6 +395,7 @@ private function getConnection() } else { switch ($this->driver = $this->conn->getDriver()->getName()) { case 'mysqli': + throw new \LogicException(sprintf('The adapter "%s" does not support the mysqli driver, use pdo_mysql instead.', \get_class($this))); case 'pdo_mysql': case 'drizzle_pdo_mysql': $this->driver = 'mysql'; From 6b2db6dc305cd1fc08ed3761e5ee1c5a1e210a83 Mon Sep 17 00:00:00 2001 From: Wouter de Jong Date: Sat, 25 Jan 2020 13:51:20 +0100 Subject: [PATCH 14/22] Improved error message when no supported user provider is found --- src/Symfony/Component/Security/Core/User/ChainUserProvider.php | 2 +- .../Component/Security/Http/Firewall/ContextListener.php | 2 +- .../Security/Http/RememberMe/AbstractRememberMeServices.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Security/Core/User/ChainUserProvider.php b/src/Symfony/Component/Security/Core/User/ChainUserProvider.php index 5ea8150a3017e..ad93e53f146ba 100644 --- a/src/Symfony/Component/Security/Core/User/ChainUserProvider.php +++ b/src/Symfony/Component/Security/Core/User/ChainUserProvider.php @@ -91,7 +91,7 @@ public function refreshUser(UserInterface $user) $e->setUsername($user->getUsername()); throw $e; } else { - throw new UnsupportedUserException(sprintf('The account "%s" is not supported.', \get_class($user))); + throw new UnsupportedUserException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', \get_class($user))); } } diff --git a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php index 6a05ee5175cb1..af912c446c249 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php @@ -238,7 +238,7 @@ protected function refreshUser(TokenInterface $token) return null; } - throw new \RuntimeException(sprintf('There is no user provider for user "%s".', $userClass)); + throw new \RuntimeException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', $userClass)); } private function safelyUnserialize($serializedToken) diff --git a/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php b/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php index bf69f3012b6ba..e47e1812212cf 100644 --- a/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php +++ b/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php @@ -239,7 +239,7 @@ final protected function getUserProvider($class) } } - throw new UnsupportedUserException(sprintf('There is no user provider that supports class "%s".', $class)); + throw new UnsupportedUserException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', $class)); } /** From ae0c6344b4b6579052742b1053baa5e89b60e4b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Mon, 27 Jan 2020 19:01:48 +0100 Subject: [PATCH 15/22] Fix exception message in Doctrine Messenger --- .../Component/Messenger/Transport/Doctrine/Connection.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php b/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php index f665e8b31c492..c0763eb157a1b 100644 --- a/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php +++ b/src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php @@ -86,13 +86,13 @@ public static function buildConfiguration($dsn, array $options = []) // check for extra keys in options $optionsExtraKeys = array_diff(array_keys($options), array_keys(self::DEFAULT_OPTIONS)); if (0 < \count($optionsExtraKeys)) { - throw new InvalidArgumentException(sprintf('Unknown option found : [%s]. Allowed options are [%s]', implode(', ', $optionsExtraKeys), implode(', ', self::DEFAULT_OPTIONS))); + throw new InvalidArgumentException(sprintf('Unknown option found : [%s]. Allowed options are [%s]', implode(', ', $optionsExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS)))); } // check for extra keys in options $queryExtraKeys = array_diff(array_keys($query), array_keys(self::DEFAULT_OPTIONS)); if (0 < \count($queryExtraKeys)) { - throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s]', implode(', ', $queryExtraKeys), implode(', ', self::DEFAULT_OPTIONS))); + throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s]', implode(', ', $queryExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS)))); } return $configuration; From 21fffcadd5f898a2fae56af9fc36d7dfcef7bd31 Mon Sep 17 00:00:00 2001 From: Patrick Berenschot Date: Mon, 27 Jan 2020 11:46:05 +0000 Subject: [PATCH 16/22] =?UTF-8?q?[Messenger]=20Check=20for=20all=20seriali?= =?UTF-8?q?zation=20exceptions=20during=20message=20dec=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Serialization/SerializerTest.php | 33 +++++++++++++++++++ .../Transport/Serialization/Serializer.php | 6 ++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Messenger/Tests/Transport/Serialization/SerializerTest.php b/src/Symfony/Component/Messenger/Tests/Transport/Serialization/SerializerTest.php index 73cbfb6cb9578..604c497bfb250 100644 --- a/src/Symfony/Component/Messenger/Tests/Transport/Serialization/SerializerTest.php +++ b/src/Symfony/Component/Messenger/Tests/Transport/Serialization/SerializerTest.php @@ -207,7 +207,40 @@ public function testEncodedSkipsNonEncodeableStamps() $encoded = $serializer->encode($envelope); $this->assertStringNotContainsString('DummySymfonySerializerNonSendableStamp', print_r($encoded['headers'], true)); } + + public function testDecodingFailedConstructorDeserialization() + { + $serializer = new Serializer(); + + $this->expectException(MessageDecodingFailedException::class); + + $serializer->decode([ + 'body' => '{}', + 'headers' => ['type' => DummySymfonySerializerInvalidConstructor::class], + ]); + } + + public function testDecodingStampFailedDeserialization() + { + $serializer = new Serializer(); + + $this->expectException(MessageDecodingFailedException::class); + + $serializer->decode([ + 'body' => '{"message":"hello"}', + 'headers' => [ + 'type' => DummyMessage::class, + 'X-Message-Stamp-'.SerializerStamp::class => '[{}]', + ], + ]); + } } class DummySymfonySerializerNonSendableStamp implements NonSendableStampInterface { } +class DummySymfonySerializerInvalidConstructor +{ + public function __construct(string $missingArgument) + { + } +} diff --git a/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php b/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php index 3c13cb6e9038e..8d4b63994a669 100644 --- a/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php +++ b/src/Symfony/Component/Messenger/Transport/Serialization/Serializer.php @@ -19,7 +19,7 @@ use Symfony\Component\Messenger\Stamp\StampInterface; use Symfony\Component\Serializer\Encoder\JsonEncoder; use Symfony\Component\Serializer\Encoder\XmlEncoder; -use Symfony\Component\Serializer\Exception\UnexpectedValueException; +use Symfony\Component\Serializer\Exception\ExceptionInterface; use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer; use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; use Symfony\Component\Serializer\Serializer as SymfonySerializer; @@ -81,7 +81,7 @@ public function decode(array $encodedEnvelope): Envelope try { $message = $this->serializer->deserialize($encodedEnvelope['body'], $encodedEnvelope['headers']['type'], $this->format, $context); - } catch (UnexpectedValueException $e) { + } catch (ExceptionInterface $e) { throw new MessageDecodingFailedException(sprintf('Could not decode message: %s.', $e->getMessage()), $e->getCode(), $e); } @@ -119,7 +119,7 @@ private function decodeStamps(array $encodedEnvelope): array try { $stamps[] = $this->serializer->deserialize($value, substr($name, \strlen(self::STAMP_HEADER_PREFIX)).'[]', $this->format, $this->context); - } catch (UnexpectedValueException $e) { + } catch (ExceptionInterface $e) { throw new MessageDecodingFailedException(sprintf('Could not decode stamp: %s.', $e->getMessage()), $e->getCode(), $e); } } From ad5f427bed252b5f98616c7aa4d62868e260fdc2 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Fri, 10 Jan 2020 23:18:38 +0000 Subject: [PATCH 17/22] =?UTF-8?q?[HttpKernel]=C2=A0Fix=20stale-if-error=20?= =?UTF-8?q?behavior,=20add=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Component/HttpFoundation/Response.php | 2 +- .../HttpKernel/HttpCache/HttpCache.php | 30 +++- .../Tests/HttpCache/HttpCacheTest.php | 162 ++++++++++++++++++ 3 files changed, 190 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index 26e3a3378efa0..0f361bac3d3c2 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -649,7 +649,7 @@ public function isImmutable() } /** - * Returns true if the response must be revalidated by caches. + * Returns true if the response must be revalidated by shared caches once it has become stale. * * This method indicates that the response must not be served stale by a * cache in any circumstance without first revalidating with the origin. diff --git a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php index da60e74642cb4..3471758525a31 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -452,13 +452,37 @@ protected function forward(Request $request, $catch = false, Response $entry = n // always a "master" request (as the real master request can be in cache) $response = SubRequestHandler::handle($this->kernel, $request, HttpKernelInterface::MASTER_REQUEST, $catch); - // we don't implement the stale-if-error on Requests, which is nonetheless part of the RFC - if (null !== $entry && \in_array($response->getStatusCode(), [500, 502, 503, 504])) { + /* + * Support stale-if-error given on Responses or as a config option. + * RFC 7234 summarizes in Section 4.2.4 (but also mentions with the individual + * Cache-Control directives) that + * + * A cache MUST NOT generate a stale response if it is prohibited by an + * explicit in-protocol directive (e.g., by a "no-store" or "no-cache" + * cache directive, a "must-revalidate" cache-response-directive, or an + * applicable "s-maxage" or "proxy-revalidate" cache-response-directive; + * see Section 5.2.2). + * + * https://tools.ietf.org/html/rfc7234#section-4.2.4 + * + * We deviate from this in one detail, namely that we *do* serve entries in the + * stale-if-error case even if they have a `s-maxage` Cache-Control directive. + */ + if (null !== $entry + && \in_array($response->getStatusCode(), [500, 502, 503, 504]) + && !$entry->headers->hasCacheControlDirective('no-cache') + && !$entry->mustRevalidate() + ) { if (null === $age = $entry->headers->getCacheControlDirective('stale-if-error')) { $age = $this->options['stale_if_error']; } - if (abs($entry->getTtl()) < $age) { + /* + * stale-if-error gives the (extra) time that the Response may be used *after* it has become stale. + * So we compare the time the $entry has been sitting in the cache already with the + * time it was fresh plus the allowed grace period. + */ + if ($entry->getAge() <= $entry->getMaxAge() + $age) { $this->record($request, 'stale-if-error'); return $entry; diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php index ef201de6cf15f..cac06a80e59da 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php @@ -1523,6 +1523,168 @@ public function testUsesOriginalRequestForSurrogate() // Surrogate request $cache->handle($request, HttpKernelInterface::SUB_REQUEST); } + + public function testStaleIfErrorMustNotResetLifetime() + { + // Make sure we don't accidentally treat the response as fresh (revalidated) again + // when stale-if-error handling kicks in. + + $responses = [ + [ + 'status' => 200, + 'body' => 'OK', + // This is cacheable and can be used in stale-if-error cases: + 'headers' => ['Cache-Control' => 'public, max-age=10', 'ETag' => 'some-etag'], + ], + [ + 'status' => 500, + 'body' => 'FAIL', + 'headers' => [], + ], + [ + 'status' => 500, + 'body' => 'FAIL', + 'headers' => [], + ], + ]; + + $this->setNextResponses($responses); + $this->cacheConfig['stale_if_error'] = 10; + + $this->request('GET', '/'); // warm cache + + sleep(15); // now the entry is stale, but still within the grace period (10s max-age + 10s stale-if-error) + + $this->request('GET', '/'); // hit backend error + $this->assertEquals(200, $this->response->getStatusCode()); // stale-if-error saved the day + $this->assertEquals(15, $this->response->getAge()); + + sleep(10); // now we're outside the grace period + + $this->request('GET', '/'); // hit backend error + $this->assertEquals(500, $this->response->getStatusCode()); // fail + } + + /** + * @dataProvider getResponseDataThatMayBeServedStaleIfError + */ + public function testResponsesThatMayBeUsedStaleIfError($responseHeaders, $sleepBetweenRequests = null) + { + $responses = [ + [ + 'status' => 200, + 'body' => 'OK', + 'headers' => $responseHeaders, + ], + [ + 'status' => 500, + 'body' => 'FAIL', + 'headers' => [], + ], + ]; + + $this->setNextResponses($responses); + $this->cacheConfig['stale_if_error'] = 10; // after stale, may be served for 10s + + $this->request('GET', '/'); // warm cache + + if ($sleepBetweenRequests) { + sleep($sleepBetweenRequests); + } + + $this->request('GET', '/'); // hit backend error + + $this->assertEquals(200, $this->response->getStatusCode()); + $this->assertEquals('OK', $this->response->getContent()); + $this->assertTraceContains('stale-if-error'); + } + + public function getResponseDataThatMayBeServedStaleIfError() + { + // All data sets assume that a 10s stale-if-error grace period has been configured + yield 'public, max-age expired' => [['Cache-Control' => 'public, max-age=60'], 65]; + yield 'public, validateable with ETag, no TTL' => [['Cache-Control' => 'public', 'ETag' => 'some-etag'], 5]; + yield 'public, validateable with Last-Modified, no TTL' => [['Cache-Control' => 'public', 'Last-Modified' => 'yesterday'], 5]; + yield 'public, s-maxage will be served stale-if-error, even if the RFC mandates otherwise' => [['Cache-Control' => 'public, s-maxage=20'], 25]; + } + + /** + * @dataProvider getResponseDataThatMustNotBeServedStaleIfError + */ + public function testResponsesThatMustNotBeUsedStaleIfError($responseHeaders, $sleepBetweenRequests = null) + { + $responses = [ + [ + 'status' => 200, + 'body' => 'OK', + 'headers' => $responseHeaders, + ], + [ + 'status' => 500, + 'body' => 'FAIL', + 'headers' => [], + ], + ]; + + $this->setNextResponses($responses); + $this->cacheConfig['stale_if_error'] = 10; // after stale, may be served for 10s + $this->cacheConfig['strict_smaxage'] = true; // full RFC compliance for this feature + + $this->request('GET', '/'); // warm cache + + if ($sleepBetweenRequests) { + sleep($sleepBetweenRequests); + } + + $this->request('GET', '/'); // hit backend error + + $this->assertEquals(500, $this->response->getStatusCode()); + } + + public function getResponseDataThatMustNotBeServedStaleIfError() + { + // All data sets assume that a 10s stale-if-error grace period has been configured + yield 'public, no TTL but beyond grace period' => [['Cache-Control' => 'public'], 15]; + yield 'public, validateable with ETag, no TTL but beyond grace period' => [['Cache-Control' => 'public', 'ETag' => 'some-etag'], 15]; + yield 'public, validateable with Last-Modified, no TTL but beyond grace period' => [['Cache-Control' => 'public', 'Last-Modified' => 'yesterday'], 15]; + yield 'public, stale beyond grace period' => [['Cache-Control' => 'public, max-age=10'], 30]; + + // Cache-control values that prohibit serving stale responses or responses without positive validation - + // see https://tools.ietf.org/html/rfc7234#section-4.2.4 and + // https://tools.ietf.org/html/rfc7234#section-5.2.2 + yield 'no-cache requires positive validation' => [['Cache-Control' => 'public, no-cache', 'ETag' => 'some-etag']]; + yield 'no-cache requires positive validation, even if fresh' => [['Cache-Control' => 'public, no-cache, max-age=10']]; + yield 'must-revalidate requires positive validation once stale' => [['Cache-Control' => 'public, max-age=10, must-revalidate'], 15]; + yield 'proxy-revalidate requires positive validation once stale' => [['Cache-Control' => 'public, max-age=10, proxy-revalidate'], 15]; + } + + public function testStaleIfErrorWhenStrictSmaxageDisabled() + { + $responses = [ + [ + 'status' => 200, + 'body' => 'OK', + 'headers' => ['Cache-Control' => 'public, s-maxage=20'], + ], + [ + 'status' => 500, + 'body' => 'FAIL', + 'headers' => [], + ], + ]; + + $this->setNextResponses($responses); + $this->cacheConfig['stale_if_error'] = 10; + $this->cacheConfig['strict_smaxage'] = false; + + $this->request('GET', '/'); // warm cache + sleep(25); + $this->request('GET', '/'); // hit backend error + + $this->assertEquals(200, $this->response->getStatusCode()); + $this->assertEquals('OK', $this->response->getContent()); + $this->assertTraceContains('stale-if-error'); + } } class TestKernel implements HttpKernelInterface From cd0db78ab554639f5f08b119c4c53daea5782ee6 Mon Sep 17 00:00:00 2001 From: noniagriconomie Date: Thu, 30 Jan 2020 17:47:09 +0100 Subject: [PATCH 18/22] [HttpClient] Fix regex bearer --- src/Symfony/Component/HttpClient/HttpClientTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/HttpClient/HttpClientTrait.php b/src/Symfony/Component/HttpClient/HttpClientTrait.php index 2914ab20b6022..298ebc741b940 100644 --- a/src/Symfony/Component/HttpClient/HttpClientTrait.php +++ b/src/Symfony/Component/HttpClient/HttpClientTrait.php @@ -86,7 +86,7 @@ private static function prepareRequest(?string $method, ?string $url, array $opt throw new InvalidArgumentException(sprintf('Option "auth_basic" must be string or an array, %s given.', \gettype($options['auth_basic']))); } - if (isset($options['auth_bearer']) && (!\is_string($options['auth_bearer']) || !preg_match('{^[-._~+/0-9a-zA-Z]++=*+$}', $options['auth_bearer']))) { + if (isset($options['auth_bearer']) && (!\is_string($options['auth_bearer']) || !preg_match('{^[-._=~+/0-9a-zA-Z]++$}', $options['auth_bearer']))) { throw new InvalidArgumentException(sprintf('Option "auth_bearer" must be a string containing only characters from the base 64 alphabet, %s given.', \is_string($options['auth_bearer']) ? 'invalid string' : \gettype($options['auth_bearer']))); } From 1edecf77c115fc1a5e7163ad1a829ed271d1ca9c Mon Sep 17 00:00:00 2001 From: Ivan Grigoriev Date: Fri, 31 Jan 2020 00:43:04 +0300 Subject: [PATCH 19/22] [Validator] fix access to uninitialized property when getting value --- .../Validator/Mapping/PropertyMetadata.php | 8 +++++++- .../Validator/Tests/Fixtures/Entity_74.php | 8 ++++++++ .../Tests/Mapping/PropertyMetadataTest.php | 13 +++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/Symfony/Component/Validator/Tests/Fixtures/Entity_74.php diff --git a/src/Symfony/Component/Validator/Mapping/PropertyMetadata.php b/src/Symfony/Component/Validator/Mapping/PropertyMetadata.php index b03a059f84350..872bd067be2be 100644 --- a/src/Symfony/Component/Validator/Mapping/PropertyMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/PropertyMetadata.php @@ -48,7 +48,13 @@ public function __construct($class, $name) */ public function getPropertyValue($object) { - return $this->getReflectionMember($object)->getValue($object); + $reflProperty = $this->getReflectionMember($object); + + if (\PHP_VERSION_ID >= 70400 && !$reflProperty->isInitialized($object)) { + return null; + } + + return $reflProperty->getValue($object); } /** diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/Entity_74.php b/src/Symfony/Component/Validator/Tests/Fixtures/Entity_74.php new file mode 100644 index 0000000000000..cb22fb7f72410 --- /dev/null +++ b/src/Symfony/Component/Validator/Tests/Fixtures/Entity_74.php @@ -0,0 +1,8 @@ +expectException('Symfony\Component\Validator\Exception\ValidatorException'); $metadata->getPropertyValue($entity); } + + /** + * @requires PHP 7.4 + */ + public function testGetPropertyValueFromUninitializedProperty() + { + $entity = new Entity_74(); + $metadata = new PropertyMetadata(self::CLASSNAME_74, 'uninitialized'); + + $this->assertNull($metadata->getPropertyValue($entity)); + } } From b2339b5e325aceffdda0c469b027b33ed43a28a1 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 31 Jan 2020 10:55:33 +0100 Subject: [PATCH 20/22] Bump phpunit-bridge cache --- phpunit | 2 +- src/Symfony/Bridge/PhpUnit/bin/simple-phpunit | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpunit b/phpunit index 200a9c28b4c34..c89d2e400b602 100755 --- a/phpunit +++ b/phpunit @@ -1,7 +1,7 @@ #!/usr/bin/env php Date: Fri, 31 Jan 2020 13:38:19 +0100 Subject: [PATCH 21/22] updated CHANGELOG for 4.3.11 --- CHANGELOG-4.3.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG-4.3.md b/CHANGELOG-4.3.md index 9c95e7e327a31..7edf539251007 100644 --- a/CHANGELOG-4.3.md +++ b/CHANGELOG-4.3.md @@ -7,6 +7,15 @@ in 4.3 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 between two versions, go to https://github.com/symfony/symfony/compare/v4.3.0...v4.3.1 +* 4.3.11 (2020-01-31) + + * bug #35530 [HttpClient] Fix regex bearer (noniagriconomie) + * bug #35532 [Validator] fix access to uninitialized property when getting value (greedyivan) + * bug #35305 [HttpKernel] Fix stale-if-error behavior, add tests (mpdude) + * bug #34808 [PhpUnitBridge] Properly handle phpunit arguments for configuration file (biozshock) + * bug #35480 [Messenger] Check for all serialization exceptions during message dec… (Patrick Berenschot) + * bug #35428 [Cache] fix checking for igbinary availability (nicolas-grekas) + * 4.3.10 (2020-01-21) * bug #35364 [Yaml] Throw on unquoted exclamation mark (fancyweb) From 26557c00997ec2ae5f5d9d3aac267082eb6dfbe7 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 31 Jan 2020 13:38:38 +0100 Subject: [PATCH 22/22] updated VERSION for 4.3.11 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index c91a5cbacfa74..a5f711805b5cd 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -73,12 +73,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl private $requestStackSize = 0; private $resetServices = false; - const VERSION = '4.3.11-DEV'; + const VERSION = '4.3.11'; const VERSION_ID = 40311; const MAJOR_VERSION = 4; const MINOR_VERSION = 3; const RELEASE_VERSION = 11; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '01/2020'; const END_OF_LIFE = '07/2020';