From b36de366973e17bfe0bd132f6f6a88cf196cda3d Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Thu, 30 Jun 2016 10:21:10 +0100 Subject: [PATCH 01/15] Fixed typos in the expectedException annotations --- src/Symfony/Component/Asset/Tests/PackagesTest.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Asset/Tests/PackagesTest.php b/src/Symfony/Component/Asset/Tests/PackagesTest.php index 81db37b996..0a78a8b4fa 100644 --- a/src/Symfony/Component/Asset/Tests/PackagesTest.php +++ b/src/Symfony/Component/Asset/Tests/PackagesTest.php @@ -14,8 +14,6 @@ namespace Symfony\Component\Asset\Tests; use Symfony\Component\Asset\Package; use Symfony\Component\Asset\Packages; use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy; -use Symfony\Component\Asset\Exception\InvalidArgumentException; -use Symfony\Component\Asset\Exception\LogicException; class PackagesTest extends \PHPUnit_Framework_TestCase { @@ -57,7 +55,7 @@ class PackagesTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException LogicException + * @expectedException \Symfony\Component\Asset\Exception\LogicException */ public function testNoDefaultPackage() { @@ -66,7 +64,7 @@ class PackagesTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException InvalidArgumentException + * @expectedException \Symfony\Component\Asset\Exception\InvalidArgumentException */ public function testUndefinedPackage() { From aa0e8bd9807627b01719108e22985be1fe658b3c Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 30 Jun 2016 13:30:07 +0200 Subject: [PATCH 02/15] Fix some lowest deps --- src/Symfony/Bundle/FrameworkBundle/composer.json | 2 +- src/Symfony/Component/HttpKernel/composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index 0d396c143c..c0a73efc61 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -24,7 +24,7 @@ "symfony/event-dispatcher": "~2.8|~3.0.0", "symfony/finder": "~2.0,>=2.0.5|~3.0.0", "symfony/http-foundation": "~2.7", - "symfony/http-kernel": "~2.7.15|~2.8.8", + "symfony/http-kernel": "~2.8.8", "symfony/polyfill-mbstring": "~1.0", "symfony/filesystem": "~2.3|~3.0.0", "symfony/routing": "~2.8|~3.0.0", diff --git a/src/Symfony/Component/HttpKernel/composer.json b/src/Symfony/Component/HttpKernel/composer.json index aa290ab62b..3ad45f979f 100644 --- a/src/Symfony/Component/HttpKernel/composer.json +++ b/src/Symfony/Component/HttpKernel/composer.json @@ -18,7 +18,7 @@ "require": { "php": ">=5.3.9", "symfony/event-dispatcher": "~2.6,>=2.6.7|~3.0.0", - "symfony/http-foundation": "~2.8.8|~3.0.8", + "symfony/http-foundation": "~2.7.15|~2.8.8|~3.0.8", "symfony/debug": "~2.6,>=2.6.2", "psr/log": "~1.0" }, From f5749df2259b9885bbaef30c037004ff13f8f1bc Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 30 Jun 2016 17:14:07 +0200 Subject: [PATCH 03/15] updated CHANGELOG for 2.7.15 --- CHANGELOG-2.7.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/CHANGELOG-2.7.md b/CHANGELOG-2.7.md index 235f166764..b4ec507066 100644 --- a/CHANGELOG-2.7.md +++ b/CHANGELOG-2.7.md @@ -7,6 +7,36 @@ in 2.7 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.7.0...v2.7.1 +* 2.7.15 (2016-06-30) + + * bug #19217 [HttpKernel] Inline ValidateRequestListener logic into HttpKernel (nicolas-grekas) + * bug #18688 [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For (magnusnordlander) + * bug #19173 [Console] Decouple SymfonyStyle from TableCell (ro0NL) + * bug #17822 [WIP] [Form] fix `empty_data` option in expanded `ChoiceType` (HeahDude) + * bug #19134 Distinguish between first and subsequent progress bar displays (rquadling) + * bug #19061 [FORM] fix post_max_size_message translation (alt. 2) (David Badura) + * bug #19100 [Console] Fixed SymfonyQuestionHelper multi-choice with defaults (sstok) + * bug #18924 [DoctrineBridge] Don't use object IDs in DoctrineChoiceLoader when passing a value closure (webmozart) + * bug #19138 [DomCrawler] No more exception on field name with strange format (guiled, fabpot) + * bug #18935 [Form] Consider a violation even if the form is not submitted (egeloen) + * bug #19127 [Form] Add exception to FormRenderer about non-unique block names (enumag) + * bug #19118 [Process] Fix pipes cleaning on Windows (nicolas-grekas) + * bug #19128 Avoid phpunit 5.4 warnings on getMock (2.7+) (iltar) + * bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicolas-grekas) + * bug #19101 [Session] fix PDO transaction aborted under PostgreSQL (Tobion) + * bug #18501 [HttpFoundation] changed MERGE queries (hjkl) + * bug #19062 [HttpFoundation] Fix UPSERT for PgSql >= 9.5 (nicolas-grekas) + * bug #18548 [Form] minor fixes in DateTime transformers (HeahDude) + * bug #18732 [PropertyAccess][DX] Enhance exception that say that some methods are missing if they don't (nykopol) + * bug #19048 [HttpFoundation] Use UPSERT for sessions stored in PgSql >= 9.5 (nicolas-grekas) + * bug #19038 Fix feature detection for IE (Alsciende) + * bug #18915 [DependencyInjection] force enabling the external XML entity loaders (xabbuh) + * bug #19020 [Form] Fixed collapsed choice attributes (HeahDude) + * bug #19028 [Yaml] properly count skipped comment lines (xabbuh) + * bug #17733 [Yaml] Fix wrong line number when comments are inserted in the middle of a block. (paradajozsef) + * bug #18911 Fixed singular of committee (peterrehm) + * bug #18971 Do not inject web debug toolbar on attachments (peterrehm) + * 2.7.14 (2016-06-06) * bug #18908 [DependencyInjection] force enabling the external XML entity loaders (xabbuh) From 0d28ce434e7bbf5d68d09cb95dc878a6a0cb623e Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 30 Jun 2016 17:14:17 +0200 Subject: [PATCH 04/15] update CONTRIBUTORS for 2.7.15 --- CONTRIBUTORS.md | 96 ++++++++++++++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 37 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 5fc732e26f..6f73ccb150 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -8,8 +8,8 @@ Symfony is the result of the work of many people who made the code better - Nicolas Grekas (nicolas-grekas) - Bernhard Schussek (bschussek) - Tobias Schultze (tobion) - - Christophe Coevoet (stof) - Christian Flothmann (xabbuh) + - Christophe Coevoet (stof) - Jordi Boggiano (seldaek) - Victor Berchet (victor) - Johannes S (johannes) @@ -17,12 +17,12 @@ Symfony is the result of the work of many people who made the code better - Jakub Zalas (jakubzalas) - Ryan Weaver (weaverryan) - Javier Eguiluz (javier.eguiluz) - - Hugo Hamon (hhamon) - Kévin Dunglas (dunglas) + - Hugo Hamon (hhamon) - Abdellatif Ait boudad (aitboudad) - Pascal Borreli (pborreli) - - Joseph Bielawski (stloyd) - Wouter De Jong (wouterj) + - Joseph Bielawski (stloyd) - Romain Neutron (romain) - Karma Dordrak (drak) - Lukas Kahwe Smith (lsmith) @@ -34,16 +34,16 @@ Symfony is the result of the work of many people who made the code better - Grégoire Pineau (lyrixx) - Eriksen Costa (eriksencosta) - Sarah Khalil (saro0h) + - Jules Pietri (heah) - Jonathan Wage (jwage) - - Diego Saint Esteben (dosten) - Maxime Steinhausser (ogizanagi) + - Diego Saint Esteben (dosten) - Alexandre Salomé (alexandresalome) - William Durand (couac) - - Jules Pietri (heah) - ornicar + - Francis Besset (francisbesset) - stealth35 ‏ (stealth35) - Alexander Mols (asm89) - - Francis Besset (francisbesset) - Bulat Shakirzyanov (avalanche123) - Saša Stamenković (umpirsky) - Henrik Bjørnskov (henrikbjorn) @@ -52,21 +52,21 @@ Symfony is the result of the work of many people who made the code better - Konstantin Kudryashov (everzet) - Bilal Amarni (bamarni) - Florin Patan (florinpatan) - - Kevin Bond (kbond) - Peter Rehm (rpet) + - Kevin Bond (kbond) - Gábor Egyed (1ed) + - Ener-Getick (energetick) - Michel Weimerskirch (mweimerskirch) - Eric Clemmons (ericclemmons) + - Iltar van der Berg (kjarli) - Andrej Hudec (pulzarraider) - Christian Raue + - Charles Sarrazin (csarrazi) - Matthias Pigulla (mpdude) - Deni - Henrik Westphal (snc) - Dariusz Górecki (canni) - Arnout Boks (aboks) - - Iltar van der Berg (kjarli) - - Charles Sarrazin (csarrazi) - - Ener-Getick (energetick) - Douglas Greenshields (shieldo) - Lee McDermott - Brandon Turner @@ -82,49 +82,50 @@ Symfony is the result of the work of many people who made the code better - Antoine Hérault (herzult) - Arnaud Le Blanc (arnaud-lb) - Jérôme Tamarelle (gromnan) + - Paráda József (paradajozsef) - Michal Piotrowski (eventhorizon) - Tim Nagel (merk) - - Paráda József (paradajozsef) - Brice BERNARD (brikou) + - Robin Chalas (chalas_r) - Alexander M. Turek (derrabus) - Dariusz Ruminski - marc.weistroff - Issei Murasawa (issei_m) - lenar - Włodzimierz Gajda (gajdaw) + - Konstantin Myakshin (koc) + - Baptiste Clavié (talus) - Alexander Schwenn (xelaris) - Florian Voutzinos (florianv) - - Konstantin Myakshin (koc) - Colin Frei - Adrien Brault (adrienbrault) - Joshua Thijssen - - Baptiste Clavié (talus) - Peter Kokot (maastermedia) - excelwebzone - Jacob Dreesen (jdreesen) + - Jáchym Toušek (enumag) - Jérémy DERUSSÉ (jderusse) - Vladimir Reznichenko (kalessil) + - Tomáš Votruba (tomas_votruba) - Fabien Pennequin (fabienpennequin) - Gordon Franke (gimler) + - Eric GELOEN (gelo) - David Buchmann (dbu) - - Tomáš Votruba (tomas_votruba) - - Jáchym Toušek - Robert Schönthal (digitalkaoz) - Florian Lonqueu-Brochard (florianlb) - - Eric GELOEN (gelo) - Stefano Sala (stefano.sala) - Juti Noppornpitak (shiroyuki) + - Titouan Galopin (tgalopin) - Tigran Azatyan (tigranazatyan) - Sebastian Hörl (blogsh) - Daniel Gomes (danielcsgomes) - Hidenori Goto (hidenorigoto) + - Sebastiaan Stok (sstok) - Evgeniy (ewgraf) + - Tugdual Saunier (tucksaun) - Guilherme Blanco (guilhermeblanco) - Pablo Godel (pgodel) - - Titouan Galopin (tgalopin) - Jérémie Augustin (jaugustin) - - Sebastiaan Stok (sstok) - - Tugdual Saunier (tucksaun) - Andréia Bohner (andreia) - Rafael Dohms (rdohms) - Arnaud Kleinpeter (nanocom) @@ -141,6 +142,7 @@ Symfony is the result of the work of many people who made the code better - Richard van Laak (rvanlaak) - Matthieu Ouellette-Vachon (maoueh) - Michał Pipa (michal.pipa) + - Javier Spagnoletti (phansys) - Amal Raghav (kertz) - Jonathan Ingram (jonathaningram) - Artur Kotyrba @@ -150,7 +152,6 @@ Symfony is the result of the work of many people who made the code better - Daniel Wehner - Possum - Dorian Villet (gnutix) - - Javier Spagnoletti (phansys) - Richard Miller (mr_r_miller) - Mario A. Alvarez Garcia (nomack84) - Dennis Benkert (denderello) @@ -179,6 +180,7 @@ Symfony is the result of the work of many people who made the code better - Sven Paulus (subsven) - Lars Strojny (lstrojny) - Rui Marinho (ruimarinho) + - Daniel Espendiller - Eugene Wissner - Julien Brochet (mewt) - Sergey Linnik (linniksa) @@ -212,9 +214,7 @@ Symfony is the result of the work of many people who made the code better - Kristen Gilden (kgilden) - Dawid Nowak - Pierre-Yves LEBECQ (pylebecq) - - Daniel Espendiller - Jakub Kucharovic (jkucharovic) - - Robin Chalas (chalas_r) - Eugene Leonovich (rybakit) - Filippo Tessarotto - Joseph Rouff (rouffj) @@ -238,6 +238,7 @@ Symfony is the result of the work of many people who made the code better - Roumen Damianoff (roumen) - Antonio J. García Lagar (ajgarlag) - Kim Hemsø Rasmussen (kimhemsoe) + - Christian Schmidt - Wouter Van Hecke - Peter Kruithof (pkruithof) - Michael Holm (hollo) @@ -245,6 +246,7 @@ Symfony is the result of the work of many people who made the code better - Hidde Wieringa (hiddewie) - Chris Smith (cs278) - Florian Klein (docteurklein) + - Oleg Voronkovich - Manuel Kiessling (manuelkiessling) - Daniel Wehner - Atsuhiro KUBO (iteman) @@ -294,7 +296,6 @@ Symfony is the result of the work of many people who made the code better - Inal DJAFAR (inalgnu) - Christian Gärtner (dagardner) - Tomasz Kowalczyk (thunderer) - - Christian Schmidt - François-Xavier de Guillebon (de-gui_f) - Damien Alexandre (damienalexandre) - Felix Labrecque @@ -322,6 +323,7 @@ Symfony is the result of the work of many people who made the code better - Endre Fejes - Tobias Naumann (tna) - Daniel Beyer + - Jhonny Lidfors (jhonne) - Shein Alexey - Baptiste Lafontaine - Joe Lencioni @@ -335,7 +337,6 @@ Symfony is the result of the work of many people who made the code better - Ivan Kurnosov - Xavier HAUSHERR - Albert Jessurum (ajessu) - - Oleg Voronkovich - Laszlo Korte - Pavel Batanov (scaytrase) - Miha Vrhovnik @@ -355,6 +356,7 @@ Symfony is the result of the work of many people who made the code better - Brian King - Michel Salib (michelsalib) - geoffrey + - Steffen Roßkamp - Valentin Jonovs (valentins-jonovs) - Jeanmonod David (jeanmonod) - Jan Schumann @@ -364,6 +366,7 @@ Symfony is the result of the work of many people who made the code better - Mihai Stancu - Olivier Dolbeau (odolbeau) - Jan Rosier (rosier) + - Magnus Nordlander (magnusnordlander) - vagrant - EdgarPE - Florian Pfitzer (marmelatze) @@ -379,6 +382,7 @@ Symfony is the result of the work of many people who made the code better - Christian Schmidt - Marek Štípek (maryo) - Marcin Sikoń (marphi) + - Roland Franssen (ro0) - Dominik Zogg (dominik.zogg) - Marek Pietrzak - Chad Sikorra (chadsikorra) @@ -390,6 +394,7 @@ Symfony is the result of the work of many people who made the code better - Zander Baldwin - Adam Harvey - Alex Bakhturin + - Alexander Obuhovich (aik099) - boombatower - Fabrice Bernhard (fabriceb) - Jérôme Macias (jeromemacias) @@ -412,10 +417,12 @@ Symfony is the result of the work of many people who made the code better - ondrowan - Barry vd. Heuvel (barryvdh) - Jerzy Zawadzki (jzawadzki) + - Théo FIDRY (theofidry) - Evan S Kaufman (evanskaufman) - mcben - Jérôme Vieilledent (lolautruche) - Maks Slesarenko + - Filip Procházka (fprochazka) - mmoreram - Markus Lanthaler (lanthaler) - Vicent Soria Durá (vicentgodella) @@ -440,7 +447,6 @@ Symfony is the result of the work of many people who made the code better - Benjamin Leveque (benji07) - Nate (frickenate) - jhonnyL - - Jhonny Lidfors (jhonne) - sasezaki - Dawid Pakuła (zulusx) - Florian Rey (nervo) @@ -503,6 +509,7 @@ Symfony is the result of the work of many people who made the code better - Maxime Douailin - Javier López (loalf) - Reinier Kip + - Geoffrey Brier (geoffrey-brier) - Dustin Dobervich (dustin10) - dantleech - Anne-Sophie Bachelard (annesophie) @@ -535,9 +542,11 @@ Symfony is the result of the work of many people who made the code better - Arturs Vonda - Sascha Grossenbacher - Szijarto Tamas + - David Badura (davidbadura) - Catalin Dan - Stephan Vock - Benjamin Zikarsky (bzikarsky) + - Anton Bakai - Simon Schick (simonsimcity) - redstar504 - Tristan Roussel @@ -556,7 +565,7 @@ Symfony is the result of the work of many people who made the code better - Richard van den Brand (ricbra) - develop - Mark Sonnabaum - - Alexander Obuhovich (aik099) + - Richard Quadling - jochenvdv - Arturas Smorgun (asarturas) - Alexander Volochnev (exelenz) @@ -573,6 +582,7 @@ Symfony is the result of the work of many people who made the code better - Baldur Rensch (brensch) - Vladyslav Petrovych - Alex Xandra Albert Sim + - Carson Full - Trent Steel (trsteel88) - Yuen-Chi Lian - Besnik Br @@ -589,6 +599,7 @@ Symfony is the result of the work of many people who made the code better - Leevi Graham (leevigraham) - Casper Valdemar Poulsen - Josiah (josiah) + - Joschi Kuphal - John Bohn (jbohn) - Marc Morera (mmoreram) - Andrew Hilobok (hilobok) @@ -618,7 +629,6 @@ Symfony is the result of the work of many people who made the code better - Adrien Lucas (adrienlucas) - James Michael DuPont - Tom Klingenberg - - Filip Procházka (fprochazka) - Christopher Hall (mythmakr) - Paul Kamer (pkamer) - Rafał Wrzeszcz (rafalwrzeszcz) @@ -637,7 +647,6 @@ Symfony is the result of the work of many people who made the code better - Neil Ferreira - Nathanael Noblet (gnat) - Dmitry Parnas (parnas) - - Théo FIDRY (theofidry) - Paul LE CORRE - DQNEO - Emanuele Iannone @@ -652,7 +661,6 @@ Symfony is the result of the work of many people who made the code better - Matt Robinson (inanimatt) - Aleksey Podskrebyshev - Calin Mihai Pristavu - - Steffen Roßkamp - David Marín Carreño (davefx) - Jörn Lang (j.lang) - Omar Yepez (oyepez003) @@ -677,6 +685,7 @@ Symfony is the result of the work of many people who made the code better - Don Pinkster - Maksim Muruev - Emil Einarsson + - Thomas Landauer - Thibault Duplessis - Marc Abramowitz - Martijn Evers @@ -697,7 +706,6 @@ Symfony is the result of the work of many people who made the code better - David Lima - Jérôme Vasseur - Brunet Laurent (lbrunet) - - Magnus Nordlander (magnusnordlander) - Mikhail Yurasov (mym) - LOUARDI Abdeltif (ouardisoft) - Robert Gruendler (pulse00) @@ -709,6 +717,7 @@ Symfony is the result of the work of many people who made the code better - Raul Fraile (raulfraile) - sensio - Patrick Kaufmann + - Piotr Stankowski - Reece Fowell (reecefowell) - Mátyás Somfai (smatyas) - stefan.r @@ -728,6 +737,7 @@ Symfony is the result of the work of many people who made the code better - Pieter - Michael Tibben - Sander Marechal + - Andre Rømcke (andrerom) - Radosław Benkel - ttomor - Mei Gwilym (meigwilym) @@ -743,6 +753,7 @@ Symfony is the result of the work of many people who made the code better - Danilo Silva - Zachary Tong (polyfractal) - Hryhorii Hrebiniuk + - Dennis Fridrich (dfridrich) - mcfedr (mcfedr) - hamza - dantleech @@ -752,6 +763,7 @@ Symfony is the result of the work of many people who made the code better - Guillaume Royer - Artem (digi) - boite + - MGDSoft - Vadim Tyukov (vatson) - Sortex - chispita @@ -804,10 +816,12 @@ Symfony is the result of the work of many people who made the code better - Benoit Garret - Thomas Royer (cydonia7) - DerManoMann + - Olaf Klischat - Jhonny Lidfors (jhonny) - Julien Bianchi (jubianchi) + - Robert Meijers - Marcin Chwedziak - - Roland Franssen (ro0) + - hjkl - Tony Cosentino (tony-co) - Rodrigo Díez Villamuera (rodrigodiez) - e-ivanov @@ -815,6 +829,7 @@ Symfony is the result of the work of many people who made the code better - Jeremy Bush - wizhippo - Viacheslav Sychov + - Carlos Ortega Huetos - rpg600 - Péter Buri (burci) - Davide Borsatto (davide.borsatto) @@ -834,6 +849,7 @@ Symfony is the result of the work of many people who made the code better - spdionis - Eduardo García Sanz (coma) - James Gilliland + - Rhodri Pugh (rodnaph) - David de Boer (ddeboer) - Gilles Doge (gido) - abulford @@ -855,7 +871,6 @@ Symfony is the result of the work of many people who made the code better - Juan Traverso - Philipp Strube - Christian Sciberras - - Anton Bakai - Clement Herreman (clemherreman) - Dan Ionut Dumitriu (danionut90) - Nyro (nyro) @@ -893,7 +908,6 @@ Symfony is the result of the work of many people who made the code better - azine - Dawid Sajdak - Ludek Stepan - - Geoffrey Brier - Aaron Stephens (astephens) - Craig Menning (cmenning) - Balázs Benyó (duplabe) @@ -917,6 +931,7 @@ Symfony is the result of the work of many people who made the code better - Cédric Lahouste (rapotor) - Samuel Vogel (samuelvogel) - Berat Doğan + - Juanmi Rodriguez Cerón - Anthony Ferrara - Klaas Cuvelier (kcuvelier) - Steve Frécinaux @@ -934,6 +949,7 @@ Symfony is the result of the work of many people who made the code better - Philip Frank - Lance McNearney - Giorgio Premi + - Ian Carroll - caponica - Matt Daum (daum) - Alberto Pirovano (geezmo) @@ -945,6 +961,7 @@ Symfony is the result of the work of many people who made the code better - Max Summe - WedgeSama - Felds Liscia + - Ahmed TAILOULOUTE (ahmedtai) - James Halsall (jaitsu) - Maxime Veber (nek-) - Sullivan SENECHAL @@ -968,6 +985,7 @@ Symfony is the result of the work of many people who made the code better - Max Romanovsky (maxromanovsky) - Mathieu Morlon - Daniel Tschinder + - Nykopol (nykopol) - Rafał Muszyński (rafmus90) - Timothy Anido (xanido) - Rick Prent @@ -1006,6 +1024,7 @@ Symfony is the result of the work of many people who made the code better - Konrad Mohrfeldt - Lance Chen - Andrey Astakhov (aast) + - Nikolay Labinskiy (e-moe) - kor3k kor3k (kor3k) - Stelian Mocanita (stelian) - Flavian (2much) @@ -1015,6 +1034,7 @@ Symfony is the result of the work of many people who made the code better - Hoffmann András - Olivier - pscheit + - Zdeněk Drahoš - Dan Harper - moldcraft - Ramon Kleiss (akathos) @@ -1137,6 +1157,7 @@ Symfony is the result of the work of many people who made the code better - Daan van Renterghem - Nicole Cordes - Bram Van der Sype (brammm) + - Guile (guile) - Julien Moulin (lizjulien) - Nikita Nefedov (nikita2206) - Mauro Foti (skler) @@ -1209,7 +1230,6 @@ Symfony is the result of the work of many people who made the code better - Haritz - Matthieu Prat - Grummfy - - Thomas Landauer - Filipe Guerra - Gerben Wijnja - Rowan Manning @@ -1260,6 +1280,7 @@ Symfony is the result of the work of many people who made the code better - Muriel (metalmumu) - Michael Pohlers (mick_the_big) - Cayetano Soriano Gallego (neoshadybeat) + - Jean Pasdeloup (pasdeloup) - Patrick McDougle (patrick-mcdougle) - Pablo Monterde Perez (plebs) - Jimmy Leger (redpanda) @@ -1298,7 +1319,6 @@ Symfony is the result of the work of many people who made the code better - Mantas Urnieža - Cas - Dusan Kasan - - Carson Full - Myke79 - Brian Debuire - Piers Warmers @@ -1332,6 +1352,7 @@ Symfony is the result of the work of many people who made the code better - Andras Ratz - andreabreu98 - Michael Schneider + - Cédric Bertolini - n-aleha - Şəhriyar İmanov - Kaipi Yann @@ -1358,6 +1379,7 @@ Symfony is the result of the work of many people who made the code better - Jon Cave - Sébastien HOUZE - Abdulkadir N. A. + - Ivan Menshykov - Yevgen Kovalienia - Lebnik - Sema @@ -1385,8 +1407,8 @@ Symfony is the result of the work of many people who made the code better - Oncle Tom - Christian Stocker - Dawid Nowak - - Richard Quadling - Karolis Daužickas + - Sergio Santoro - tirnanog06 - phc - Дмитрий Пацура @@ -1412,7 +1434,6 @@ Symfony is the result of the work of many people who made the code better - Loïc Vernet (coil) - Christoph Schaefer (cvschaefer) - Damon Jones (damon__jones) - - David Badura (davidbadura) - Daniel Londero (dlondero) - Sebastian Landwehr (dword123) - Adel ELHAIBA (eadel) @@ -1420,6 +1441,7 @@ Symfony is the result of the work of many people who made the code better - Elliot Anderson (elliot) - Sergey Zolotov (enleur) - Fabien D. (fabd) + - Carsten Eilers (fnc) - Sorin Gitlan (forapathy) - Yohan Giarelli (frequence-web) - Gerry Vandermaesen (gerryvdm) From ec1ff36e58b8809efd67bb03c40e39cdb7a80b13 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 30 Jun 2016 17:14:22 +0200 Subject: [PATCH 05/15] updated VERSION for 2.7.15 --- 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 26a6813e49..e9e9732609 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -58,12 +58,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.7.15-DEV'; + const VERSION = '2.7.15'; const VERSION_ID = 20715; const MAJOR_VERSION = 2; const MINOR_VERSION = 7; const RELEASE_VERSION = 15; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '05/2018'; const END_OF_LIFE = '05/2019'; From 6cdb090dd05cd3f992ffdc64b34dee0d1e55ef68 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 30 Jun 2016 17:39:56 +0200 Subject: [PATCH 06/15] bumped Symfony version to 2.7.16 --- 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 e9e9732609..6e4ca26219 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -58,12 +58,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.7.15'; - const VERSION_ID = 20715; + const VERSION = '2.7.16-DEV'; + const VERSION_ID = 20716; const MAJOR_VERSION = 2; const MINOR_VERSION = 7; - const RELEASE_VERSION = 15; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 16; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '05/2018'; const END_OF_LIFE = '05/2019'; From c513e81d602bfce7a661a1f54afbaf84918b0bc7 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 30 Jun 2016 17:42:06 +0200 Subject: [PATCH 07/15] updated CHANGELOG for 2.8.8 --- CHANGELOG-2.8.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/CHANGELOG-2.8.md b/CHANGELOG-2.8.md index 52ff682833..27060f7527 100644 --- a/CHANGELOG-2.8.md +++ b/CHANGELOG-2.8.md @@ -7,6 +7,39 @@ in 2.8 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/v2.8.0...v2.8.1 +* 2.8.8 (2016-06-30) + + * bug #19217 [HttpKernel] Inline ValidateRequestListener logic into HttpKernel (nicolas-grekas) + * bug #18688 [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For (magnusnordlander) + * bug #19173 [Console] Decouple SymfonyStyle from TableCell (ro0NL) + * bug #19189 [Console] Fix formatting of SymfonyStyle::comment() (chalasr) + * bug #19211 [Form] fix post max size translation type extension for >= 2.8 (Tobion) + * bug #17822 [WIP] [Form] fix `empty_data` option in expanded `ChoiceType` (HeahDude) + * bug #19134 Distinguish between first and subsequent progress bar displays (rquadling) + * bug #19061 [FORM] fix post_max_size_message translation (alt. 2) (David Badura) + * bug #19100 [Console] Fixed SymfonyQuestionHelper multi-choice with defaults (sstok) + * bug #18924 [DoctrineBridge] Don't use object IDs in DoctrineChoiceLoader when passing a value closure (webmozart) + * bug #19138 [DomCrawler] No more exception on field name with strange format (guiled, fabpot) + * bug #18935 [Form] Consider a violation even if the form is not submitted (egeloen) + * bug #19127 [Form] Add exception to FormRenderer about non-unique block names (enumag) + * bug #19118 [Process] Fix pipes cleaning on Windows (nicolas-grekas) + * bug #19128 Avoid phpunit 5.4 warnings on getMock (2.7+) (iltar) + * bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicolas-grekas) + * bug #19101 [Session] fix PDO transaction aborted under PostgreSQL (Tobion) + * bug #18501 [HttpFoundation] changed MERGE queries (hjkl) + * bug #19062 [HttpFoundation] Fix UPSERT for PgSql >= 9.5 (nicolas-grekas) + * bug #18548 [Form] minor fixes in DateTime transformers (HeahDude) + * bug #18732 [PropertyAccess][DX] Enhance exception that say that some methods are missing if they don't (nykopol) + * bug #19048 [HttpFoundation] Use UPSERT for sessions stored in PgSql >= 9.5 (nicolas-grekas) + * bug #19038 Fix feature detection for IE (Alsciende) + * bug #18915 [DependencyInjection] force enabling the external XML entity loaders (xabbuh) + * bug #19020 [Form] Fixed collapsed choice attributes (HeahDude) + * bug #19028 [Yaml] properly count skipped comment lines (xabbuh) + * bug #19009 [WebProfilerBundle] Fix invalid CSS style (romainneutron) + * bug #17733 [Yaml] Fix wrong line number when comments are inserted in the middle of a block. (paradajozsef) + * bug #18911 Fixed singular of committee (peterrehm) + * bug #18971 Do not inject web debug toolbar on attachments (peterrehm) + * 2.8.7 (2016-06-06) * bug #18908 [DependencyInjection] force enabling the external XML entity loaders (xabbuh) From 938682b02e6eda1b1a0b59abbe05da0a91304b54 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 30 Jun 2016 17:42:15 +0200 Subject: [PATCH 08/15] updated VERSION for 2.8.8 --- 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 55b1a955e2..2032b56120 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,12 +59,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.8.8-DEV'; + const VERSION = '2.8.8'; const VERSION_ID = 20808; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; const RELEASE_VERSION = 8; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '11/2018'; const END_OF_LIFE = '11/2019'; From e0f1476bfe020b50bfb6d12d5df223d0b0c51e87 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 30 Jun 2016 18:28:54 +0200 Subject: [PATCH 09/15] bumped Symfony version to 2.8.9 --- 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 2032b56120..cd3b372388 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,12 +59,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.8.8'; - const VERSION_ID = 20808; + const VERSION = '2.8.9-DEV'; + const VERSION_ID = 20809; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; - const RELEASE_VERSION = 8; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 9; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2018'; const END_OF_LIFE = '11/2019'; From a3f75100bfe30d0584e89235c7b5cac2dcfa40be Mon Sep 17 00:00:00 2001 From: Jean Pasdeloup Date: Wed, 29 Jun 2016 10:49:46 +0200 Subject: [PATCH 10/15] [Security][Guard] check if session exist before using it --- .../AbstractFormLoginAuthenticator.php | 12 +- .../FormLoginAuthenticatorTest.php | 212 ++++++++++++++++++ 2 files changed, 222 insertions(+), 2 deletions(-) create mode 100644 src/Symfony/Component/Security/Guard/Tests/Authenticator/FormLoginAuthenticatorTest.php diff --git a/src/Symfony/Component/Security/Guard/Authenticator/AbstractFormLoginAuthenticator.php b/src/Symfony/Component/Security/Guard/Authenticator/AbstractFormLoginAuthenticator.php index b3c6bd73a0..6d6d14edb5 100644 --- a/src/Symfony/Component/Security/Guard/Authenticator/AbstractFormLoginAuthenticator.php +++ b/src/Symfony/Component/Security/Guard/Authenticator/AbstractFormLoginAuthenticator.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Security\Guard\Authenticator; +use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Guard\AbstractGuardAuthenticator; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\Request; @@ -52,7 +53,10 @@ abstract class AbstractFormLoginAuthenticator extends AbstractGuardAuthenticator */ public function onAuthenticationFailure(Request $request, AuthenticationException $exception) { - $request->getSession()->set(Security::AUTHENTICATION_ERROR, $exception); + if ($request->getSession() instanceof SessionInterface) { + $request->getSession()->set(Security::AUTHENTICATION_ERROR, $exception); + } + $url = $this->getLoginUrl(); return new RedirectResponse($url); @@ -69,9 +73,13 @@ abstract class AbstractFormLoginAuthenticator extends AbstractGuardAuthenticator */ public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey) { + $targetPath = null; + // if the user hit a secure page and start() was called, this was // the URL they were on, and probably where you want to redirect to - $targetPath = $request->getSession()->get('_security.'.$providerKey.'.target_path'); + if ($request->getSession() instanceof SessionInterface) { + $targetPath = $request->getSession()->get('_security.'.$providerKey.'.target_path'); + } if (!$targetPath) { $targetPath = $this->getDefaultSuccessRedirectUrl(); diff --git a/src/Symfony/Component/Security/Guard/Tests/Authenticator/FormLoginAuthenticatorTest.php b/src/Symfony/Component/Security/Guard/Tests/Authenticator/FormLoginAuthenticatorTest.php new file mode 100644 index 0000000000..3dbbf845c5 --- /dev/null +++ b/src/Symfony/Component/Security/Guard/Tests/Authenticator/FormLoginAuthenticatorTest.php @@ -0,0 +1,212 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Security\Guard\Tests\Authenticator; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\Security\Core\Exception\AuthenticationException; +use Symfony\Component\Security\Core\User\UserInterface; +use Symfony\Component\Security\Core\User\UserProviderInterface; +use Symfony\Component\Security\Guard\Authenticator\AbstractFormLoginAuthenticator; + +/** + * @author Jean Pasdeloup + */ +class FormLoginAuthenticatorTest extends \PHPUnit_Framework_TestCase +{ + private $requestWithoutSession; + private $requestWithSession; + private $authenticator; + + const LOGIN_URL = 'http://login'; + const DEFAULT_SUCCESS_URL = 'http://defaultsuccess'; + const CUSTOM_SUCCESS_URL = 'http://customsuccess'; + + public function testAuthenticationFailureWithoutSession() + { + $failureResponse = $this->authenticator->onAuthenticationFailure($this->requestWithoutSession, new AuthenticationException()); + + $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $failureResponse); + $this->assertEquals(self::LOGIN_URL, $failureResponse->getTargetUrl()); + } + + public function testAuthenticationFailureWithSession() + { + $this->requestWithSession->getSession() + ->expects($this->once()) + ->method('set'); + + $failureResponse = $this->authenticator->onAuthenticationFailure($this->requestWithSession, new AuthenticationException()); + + $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $failureResponse); + $this->assertEquals(self::LOGIN_URL, $failureResponse->getTargetUrl()); + } + + public function testAuthenticationSuccessWithoutSession() + { + $token = $this->getMockBuilder('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface') + ->disableOriginalConstructor() + ->getMock(); + + $redirectResponse = $this->authenticator->onAuthenticationSuccess($this->requestWithoutSession, $token, 'providerkey'); + + $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $redirectResponse); + $this->assertEquals(self::DEFAULT_SUCCESS_URL, $redirectResponse->getTargetUrl()); + } + + public function testAuthenticationSuccessWithSessionButEmpty() + { + $token = $this->getMockBuilder('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->requestWithSession->getSession() + ->expects($this->once()) + ->method('get') + ->will($this->returnValue(null)); + + $redirectResponse = $this->authenticator->onAuthenticationSuccess($this->requestWithSession, $token, 'providerkey'); + + $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $redirectResponse); + $this->assertEquals(self::DEFAULT_SUCCESS_URL, $redirectResponse->getTargetUrl()); + } + + public function testAuthenticationSuccessWithSessionAndTarget() + { + $token = $this->getMockBuilder('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->requestWithSession->getSession() + ->expects($this->once()) + ->method('get') + ->will($this->returnValue(self::CUSTOM_SUCCESS_URL)); + + $redirectResponse = $this->authenticator->onAuthenticationSuccess($this->requestWithSession, $token, 'providerkey'); + + $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $redirectResponse); + $this->assertEquals(self::CUSTOM_SUCCESS_URL, $redirectResponse->getTargetUrl()); + } + + public function testRememberMe() + { + $doSupport = $this->authenticator->supportsRememberMe(); + + $this->assertTrue($doSupport); + } + + public function testStartWithoutSession() + { + $failureResponse = $this->authenticator->start($this->requestWithoutSession, new AuthenticationException()); + + $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $failureResponse); + $this->assertEquals(self::LOGIN_URL, $failureResponse->getTargetUrl()); + } + + public function testStartWithSession() + { + $failureResponse = $this->authenticator->start($this->requestWithSession, new AuthenticationException()); + + $this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $failureResponse); + $this->assertEquals(self::LOGIN_URL, $failureResponse->getTargetUrl()); + } + + protected function setUp() + { + $this->requestWithoutSession = new Request(array(), array(), array(), array(), array(), array()); + $this->requestWithSession = new Request(array(), array(), array(), array(), array(), array()); + + $session = $this->getMockBuilder('Symfony\\Component\\HttpFoundation\\Session\\SessionInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->requestWithSession->setSession($session); + + $this->authenticator = new TestFormLoginAuthenticator(); + $this->authenticator + ->setLoginUrl(self::LOGIN_URL) + ->setDefaultSuccessRedirectUrl(self::DEFAULT_SUCCESS_URL) + ; + } + + protected function tearDown() + { + $this->request = null; + $this->requestWithSession = null; + } +} + +class TestFormLoginAuthenticator extends AbstractFormLoginAuthenticator +{ + private $loginUrl; + private $defaultSuccessRedirectUrl; + + /** + * @param mixed $defaultSuccessRedirectUrl + * + * @return TestFormLoginAuthenticator + */ + public function setDefaultSuccessRedirectUrl($defaultSuccessRedirectUrl) + { + $this->defaultSuccessRedirectUrl = $defaultSuccessRedirectUrl; + + return $this; + } + + /** + * @param mixed $loginUrl + * + * @return TestFormLoginAuthenticator + */ + public function setLoginUrl($loginUrl) + { + $this->loginUrl = $loginUrl; + + return $this; + } + + /** + * {@inheritdoc} + */ + protected function getLoginUrl() + { + return $this->loginUrl; + } + + /** + * {@inheritdoc} + */ + protected function getDefaultSuccessRedirectUrl() + { + return $this->defaultSuccessRedirectUrl; + } + + /** + * {@inheritdoc} + */ + public function getCredentials(Request $request) + { + return 'credentials'; + } + + /** + * {@inheritdoc} + */ + public function getUser($credentials, UserProviderInterface $userProvider) + { + return $userProvider->loadUserByUsername($credentials); + } + + /** + * {@inheritdoc} + */ + public function checkCredentials($credentials, UserInterface $user) + { + return true; + } +} From dc130be43c76d2ab286a0e397f67f678dfb39dce Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Thu, 30 Jun 2016 20:05:08 +0200 Subject: [PATCH 11/15] [Console] Fix for block() padding formatting after #19189 Prevent future regression --- .../Component/Console/Style/SymfonyStyle.php | 14 ++++++++------ .../Style/SymfonyStyle/command/command_16.php | 15 +++++++++++++++ .../Style/SymfonyStyle/output/output_16.txt | 8 ++++++++ 3 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php create mode 100644 src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt diff --git a/src/Symfony/Component/Console/Style/SymfonyStyle.php b/src/Symfony/Component/Console/Style/SymfonyStyle.php index 59c5bbf87e..a9c5744342 100644 --- a/src/Symfony/Component/Console/Style/SymfonyStyle.php +++ b/src/Symfony/Component/Console/Style/SymfonyStyle.php @@ -410,9 +410,16 @@ class SymfonyStyle extends OutputStyle } } + $firstLineIndex = 0; + if ($padding && $this->isDecorated()) { + $firstLineIndex = 1; + array_unshift($lines, ''); + $lines[] = ''; + } + foreach ($lines as $i => &$line) { if (null !== $type) { - $line = 0 === $i ? $type.$line : $lineIndentation.$line; + $line = $firstLineIndex === $i ? $type.$line : $lineIndentation.$line; } $line = $prefix.$line; @@ -423,11 +430,6 @@ class SymfonyStyle extends OutputStyle } } - if ($padding && $this->isDecorated()) { - array_unshift($lines, ''); - $lines[] = ''; - } - return $lines; } } diff --git a/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php b/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php new file mode 100644 index 0000000000..f21fc10d9c --- /dev/null +++ b/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/command/command_16.php @@ -0,0 +1,15 @@ +setDecorated(true); + $output = new SymfonyStyleWithForcedLineLength($input, $output); + $output->success( + 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum', + 'TEST' + ); +}; diff --git a/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt b/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt new file mode 100644 index 0000000000..a0d180165b --- /dev/null +++ b/src/Symfony/Component/Console/Tests/Fixtures/Style/SymfonyStyle/output/output_16.txt @@ -0,0 +1,8 @@ + +  + [OK] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore  + magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo  + consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.  + Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum  +  + From ebbc7068f95a6cb0c8c8d6dc1397fa6c333911d1 Mon Sep 17 00:00:00 2001 From: Ben Oman Date: Sat, 25 Jun 2016 17:51:43 -0600 Subject: [PATCH 12/15] Fix for #19183 to add support for new PHP MongoDB extension in sessions. --- .../Storage/Handler/MongoDbSessionHandler.php | 68 +++++++-- .../Handler/MongoDbSessionHandlerTest.php | 132 ++++++++++++++---- 2 files changed, 162 insertions(+), 38 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php index f1df25d0a6..23bca61e60 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -61,15 +61,15 @@ class MongoDbSessionHandler implements \SessionHandlerInterface * If you use such an index, you can drop `gc_probability` to 0 since * no garbage-collection is required. * - * @param \Mongo|\MongoClient $mongo A MongoClient or Mongo instance - * @param array $options An associative array of field options + * @param \Mongo|\MongoClient|\MongoDB\Client $mongo A MongoDB\Client, MongoClient or Mongo instance + * @param array $options An associative array of field options * * @throws \InvalidArgumentException When MongoClient or Mongo instance not provided * @throws \InvalidArgumentException When "database" or "collection" not provided */ public function __construct($mongo, array $options) { - if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo)) { + if (!($mongo instanceof \MongoDB\Client || $mongo instanceof \MongoClient || $mongo instanceof \Mongo)) { throw new \InvalidArgumentException('MongoClient or Mongo instance required'); } @@ -108,7 +108,9 @@ class MongoDbSessionHandler implements \SessionHandlerInterface */ public function destroy($sessionId) { - $this->getCollection()->remove(array( + $methodName = ($this->mongo instanceof \MongoDB\Client) ? 'deleteOne' : 'remove'; + + $this->getCollection()->$methodName(array( $this->options['id_field'] => $sessionId, )); @@ -120,8 +122,10 @@ class MongoDbSessionHandler implements \SessionHandlerInterface */ public function gc($maxlifetime) { - $this->getCollection()->remove(array( - $this->options['expiry_field'] => array('$lt' => new \MongoDate()), + $methodName = ($this->mongo instanceof \MongoDB\Client) ? 'deleteOne' : 'remove'; + + $this->getCollection()->$methodName(array( + $this->options['expiry_field'] => array('$lt' => $this->createDateTime()), )); return true; @@ -132,18 +136,28 @@ class MongoDbSessionHandler implements \SessionHandlerInterface */ public function write($sessionId, $data) { - $expiry = new \MongoDate(time() + (int) ini_get('session.gc_maxlifetime')); + $expiry = $this->createDateTime(time() + (int) ini_get('session.gc_maxlifetime')); $fields = array( - $this->options['data_field'] => new \MongoBinData($data, \MongoBinData::BYTE_ARRAY), - $this->options['time_field'] => new \MongoDate(), + $this->options['time_field'] => $this->createDateTime(), $this->options['expiry_field'] => $expiry, ); - $this->getCollection()->update( + $options = array('upsert' => true); + + if ($this->mongo instanceof \MongoDB\Client) { + $fields[$this->options['data_field']] = new \MongoDB\BSON\Binary($data, \MongoDB\BSON\Binary::TYPE_OLD_BINARY); + } else { + $fields[$this->options['data_field']] = new \MongoBinData($data, \MongoBinData::BYTE_ARRAY); + $options['multiple'] = false; + } + + $methodName = ($this->mongo instanceof \MongoDB\Client) ? 'updateOne' : 'update'; + + $this->getCollection()->$methodName( array($this->options['id_field'] => $sessionId), array('$set' => $fields), - array('upsert' => true, 'multiple' => false) + $options ); return true; @@ -156,10 +170,18 @@ class MongoDbSessionHandler implements \SessionHandlerInterface { $dbData = $this->getCollection()->findOne(array( $this->options['id_field'] => $sessionId, - $this->options['expiry_field'] => array('$gte' => new \MongoDate()), + $this->options['expiry_field'] => array('$gte' => $this->createDateTime()), )); - return null === $dbData ? '' : $dbData[$this->options['data_field']]->bin; + if (null === $dbData) { + return ''; + } + + if ($dbData[$this->options['data_field']] instanceof \MongoDB\BSON\Binary) { + return $dbData[$this->options['data_field']]->getData(); + } + + return $dbData[$this->options['data_field']]->bin; } /** @@ -185,4 +207,24 @@ class MongoDbSessionHandler implements \SessionHandlerInterface { return $this->mongo; } + + /** + * Create a date object using the class appropriate for the current mongo connection. + * + * Return an instance of a MongoDate or \MongoDB\BSON\UTCDateTime + * + * @param int $seconds An integer representing UTC seconds since Jan 1 1970. Defaults to now. + */ + private function createDateTime($seconds = null) + { + if (is_null($seconds)) { + $seconds = time(); + } + + if ($this->mongo instanceof \MongoDB\Client) { + return new \MongoDB\BSON\UTCDateTime($seconds * 1000); + } + + return new \MongoDate($seconds); + } } diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php index 556f26a33c..0ae0d4b2f7 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php @@ -15,7 +15,6 @@ use Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandl /** * @author Markus Bachmann - * @requires extension mongo * @group time-sensitive */ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase @@ -31,7 +30,15 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase { parent::setUp(); - $mongoClass = version_compare(phpversion('mongo'), '1.3.0', '<') ? 'Mongo' : 'MongoClient'; + if (!extension_loaded('mongo') && !extension_loaded('mongodb')) { + $this->markTestSkipped('The Mongo or MongoDB extension is required.'); + } + + if (phpversion('mongodb')) { + $mongoClass = 'MongoDB\Client'; + } else { + $mongoClass = version_compare(phpversion('mongo'), '1.3.0', '<') ? 'Mongo' : 'MongoClient'; + } $this->mongo = $this->getMockBuilder($mongoClass) ->disableOriginalConstructor() @@ -98,14 +105,28 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase $that->assertArrayHasKey($that->options['expiry_field'], $criteria); $that->assertArrayHasKey('$gte', $criteria[$that->options['expiry_field']]); - $that->assertInstanceOf('MongoDate', $criteria[$that->options['expiry_field']]['$gte']); - $that->assertGreaterThanOrEqual($criteria[$that->options['expiry_field']]['$gte']->sec, $testTimeout); - return array( + if (phpversion('mongodb')) { + $that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $criteria[$that->options['expiry_field']]['$gte']); + $that->assertGreaterThanOrEqual(round(intval((string) $criteria[$that->options['expiry_field']]['$gte']) / 1000), $testTimeout); + } else { + $that->assertInstanceOf('MongoDate', $criteria[$that->options['expiry_field']]['$gte']); + $that->assertGreaterThanOrEqual($criteria[$that->options['expiry_field']]['$gte']->sec, $testTimeout); + } + + $fields = array( $that->options['id_field'] => 'foo', - $that->options['data_field'] => new \MongoBinData('bar', \MongoBinData::BYTE_ARRAY), - $that->options['id_field'] => new \MongoDate(), ); + + if (phpversion('mongodb')) { + $fields[$that->options['data_field']] = new \MongoDB\BSON\Binary('bar', \MongoDB\BSON\Binary::TYPE_OLD_BINARY); + $fields[$that->options['id_field']] = new \MongoDB\BSON\UTCDateTime(time() * 1000); + } else { + $fields[$that->options['data_field']] = new \MongoBinData('bar', \MongoBinData::BYTE_ARRAY); + $fields[$that->options['id_field']] = new \MongoDate(); + } + + return $fields; })); $this->assertEquals('bar', $this->storage->read('foo')); @@ -123,11 +144,18 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase $that = $this; $data = array(); + $methodName = phpversion('mongodb') ? 'updateOne' : 'update'; + $collection->expects($this->once()) - ->method('update') + ->method($methodName) ->will($this->returnCallback(function ($criteria, $updateData, $options) use ($that, &$data) { $that->assertEquals(array($that->options['id_field'] => 'foo'), $criteria); - $that->assertEquals(array('upsert' => true, 'multiple' => false), $options); + + if (phpversion('mongodb')) { + $that->assertEquals(array('upsert' => true), $options); + } else { + $that->assertEquals(array('upsert' => true, 'multiple' => false), $options); + } $data = $updateData['$set']; })); @@ -135,10 +163,17 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase $expectedExpiry = time() + (int) ini_get('session.gc_maxlifetime'); $this->assertTrue($this->storage->write('foo', 'bar')); - $this->assertEquals('bar', $data[$this->options['data_field']]->bin); - $that->assertInstanceOf('MongoDate', $data[$this->options['time_field']]); - $this->assertInstanceOf('MongoDate', $data[$this->options['expiry_field']]); - $this->assertGreaterThanOrEqual($expectedExpiry, $data[$this->options['expiry_field']]->sec); + if (phpversion('mongodb')) { + $that->assertEquals('bar', $data[$that->options['data_field']]->getData()); + $that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$that->options['time_field']]); + $that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$that->options['expiry_field']]); + $that->assertGreaterThanOrEqual($expectedExpiry, round(intval((string) $data[$that->options['expiry_field']]) / 1000)); + } else { + $that->assertEquals('bar', $data[$that->options['data_field']]->bin); + $that->assertInstanceOf('MongoDate', $data[$that->options['time_field']]); + $that->assertInstanceOf('MongoDate', $data[$that->options['expiry_field']]); + $that->assertGreaterThanOrEqual($expectedExpiry, $data[$that->options['expiry_field']]->sec); + } } public function testWriteWhenUsingExpiresField() @@ -164,20 +199,33 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase $that = $this; $data = array(); + $methodName = phpversion('mongodb') ? 'updateOne' : 'update'; + $collection->expects($this->once()) - ->method('update') + ->method($methodName) ->will($this->returnCallback(function ($criteria, $updateData, $options) use ($that, &$data) { $that->assertEquals(array($that->options['id_field'] => 'foo'), $criteria); - $that->assertEquals(array('upsert' => true, 'multiple' => false), $options); + + if (phpversion('mongodb')) { + $that->assertEquals(array('upsert' => true), $options); + } else { + $that->assertEquals(array('upsert' => true, 'multiple' => false), $options); + } $data = $updateData['$set']; })); $this->assertTrue($this->storage->write('foo', 'bar')); - $this->assertEquals('bar', $data[$this->options['data_field']]->bin); - $that->assertInstanceOf('MongoDate', $data[$this->options['time_field']]); - $that->assertInstanceOf('MongoDate', $data[$this->options['expiry_field']]); + if (phpversion('mongodb')) { + $that->assertEquals('bar', $data[$that->options['data_field']]->getData()); + $that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$that->options['time_field']]); + $that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$that->options['expiry_field']]); + } else { + $that->assertEquals('bar', $data[$that->options['data_field']]->bin); + $that->assertInstanceOf('MongoDate', $data[$that->options['time_field']]); + $that->assertInstanceOf('MongoDate', $data[$that->options['expiry_field']]); + } } public function testReplaceSessionData() @@ -191,8 +239,10 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase $data = array(); + $methodName = phpversion('mongodb') ? 'updateOne' : 'update'; + $collection->expects($this->exactly(2)) - ->method('update') + ->method($methodName) ->will($this->returnCallback(function ($criteria, $updateData, $options) use (&$data) { $data = $updateData; })); @@ -200,7 +250,11 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase $this->storage->write('foo', 'bar'); $this->storage->write('foo', 'foobar'); - $this->assertEquals('foobar', $data['$set'][$this->options['data_field']]->bin); + if (phpversion('mongodb')) { + $this->assertEquals('foobar', $data['$set'][$this->options['data_field']]->getData()); + } else { + $this->assertEquals('foobar', $data['$set'][$this->options['data_field']]->bin); + } } public function testDestroy() @@ -212,8 +266,10 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase ->with($this->options['database'], $this->options['collection']) ->will($this->returnValue($collection)); + $methodName = phpversion('mongodb') ? 'deleteOne' : 'remove'; + $collection->expects($this->once()) - ->method('remove') + ->method($methodName) ->with(array($this->options['id_field'] => 'foo')); $this->assertTrue($this->storage->destroy('foo')); @@ -230,19 +286,45 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase $that = $this; + $methodName = phpversion('mongodb') ? 'deleteOne' : 'remove'; + $collection->expects($this->once()) - ->method('remove') + ->method($methodName) ->will($this->returnCallback(function ($criteria) use ($that) { - $that->assertInstanceOf('MongoDate', $criteria[$that->options['expiry_field']]['$lt']); - $that->assertGreaterThanOrEqual(time() - 1, $criteria[$that->options['expiry_field']]['$lt']->sec); + if (phpversion('mongodb')) { + $that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $criteria[$that->options['expiry_field']]['$lt']); + $that->assertGreaterThanOrEqual(time() - 1, round(intval((string) $criteria[$that->options['expiry_field']]['$lt']) / 1000)); + } else { + $that->assertInstanceOf('MongoDate', $criteria[$that->options['expiry_field']]['$lt']); + $that->assertGreaterThanOrEqual(time() - 1, $criteria[$that->options['expiry_field']]['$lt']->sec); + } })); $this->assertTrue($this->storage->gc(1)); } + public function testGetConnection() + { + $method = new \ReflectionMethod($this->storage, 'getMongo'); + $method->setAccessible(true); + + if (phpversion('mongodb')) { + $mongoClass = 'MongoDB\Client'; + } else { + $mongoClass = version_compare(phpversion('mongo'), '1.3.0', '<') ? 'Mongo' : 'MongoClient'; + } + + $this->assertInstanceOf($mongoClass, $method->invoke($this->storage)); + } + private function createMongoCollectionMock() { - $collection = $this->getMockBuilder('MongoCollection') + $collectionClass = 'MongoCollection'; + if (phpversion('mongodb')) { + $collectionClass = 'MongoDB\Collection'; + } + + $collection = $this->getMockBuilder($collectionClass) ->disableOriginalConstructor() ->getMock(); From 7696c95b17a7391fc6a1d48ff9d46512dd5e9d46 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 1 Jul 2016 08:55:04 +0200 Subject: [PATCH 13/15] skip test with current phpunit bridge --- .../DependencyInjection/Tests/ContainerBuilderTest.php | 3 +++ src/Symfony/Component/Yaml/Tests/ParserTest.php | 1 + 2 files changed, 4 insertions(+) diff --git a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php index f9f6aabe73..ac66d48b3a 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php @@ -60,6 +60,9 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase } } + /** + * @requires function Symfony\Bridge\PhpUnit\ErrorAssert::assertDeprecationsAreTriggered + */ public function testCreateDeprecatedService() { ErrorAssert::assertDeprecationsAreTriggered('The "deprecated_foo" service is deprecated. You should stop using it, as it will soon be removed.', function () { diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index 7b36819535..9e9a715ad1 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -928,6 +928,7 @@ EOF; /** * @group legacy * throw ParseException in Symfony 3.0 + * @requires function Symfony\Bridge\PhpUnit\ErrorAssert::assertDeprecationsAreTriggered */ public function testColonInMappingValueException() { From 81b0cc7c7289f969fb477b939a8496152d26d931 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 1 Jul 2016 09:20:22 +0200 Subject: [PATCH 14/15] fixed CS --- .../Storage/Handler/MongoDbSessionHandler.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php index 23bca61e60..7efc1348c8 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -19,7 +19,7 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; class MongoDbSessionHandler implements \SessionHandlerInterface { /** - * @var \Mongo + * @var \Mongo|\MongoClient|\MongoDB\Client */ private $mongo; @@ -108,7 +108,7 @@ class MongoDbSessionHandler implements \SessionHandlerInterface */ public function destroy($sessionId) { - $methodName = ($this->mongo instanceof \MongoDB\Client) ? 'deleteOne' : 'remove'; + $methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteOne' : 'remove'; $this->getCollection()->$methodName(array( $this->options['id_field'] => $sessionId, @@ -122,7 +122,7 @@ class MongoDbSessionHandler implements \SessionHandlerInterface */ public function gc($maxlifetime) { - $methodName = ($this->mongo instanceof \MongoDB\Client) ? 'deleteOne' : 'remove'; + $methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteOne' : 'remove'; $this->getCollection()->$methodName(array( $this->options['expiry_field'] => array('$lt' => $this->createDateTime()), @@ -152,7 +152,7 @@ class MongoDbSessionHandler implements \SessionHandlerInterface $options['multiple'] = false; } - $methodName = ($this->mongo instanceof \MongoDB\Client) ? 'updateOne' : 'update'; + $methodName = $this->mongo instanceof \MongoDB\Client ? 'updateOne' : 'update'; $this->getCollection()->$methodName( array($this->options['id_field'] => $sessionId), @@ -201,7 +201,7 @@ class MongoDbSessionHandler implements \SessionHandlerInterface /** * Return a Mongo instance. * - * @return \Mongo + * @return \Mongo|\MongoClient|\MongoDB\Client */ protected function getMongo() { @@ -217,7 +217,7 @@ class MongoDbSessionHandler implements \SessionHandlerInterface */ private function createDateTime($seconds = null) { - if (is_null($seconds)) { + if (null === $seconds) { $seconds = time(); } From 72fd0b82c5157975ebdb034b457f087a5a7d36e5 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 1 Jul 2016 16:56:05 +0200 Subject: [PATCH 15/15] [travis] Fix deps=low/high builds --- .github/travis.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/travis.php b/.github/travis.php index 1d036d4f42..695c69604f 100644 --- a/.github/travis.php +++ b/.github/travis.php @@ -46,8 +46,8 @@ foreach ($dirs as $dir) { $versions = file_get_contents('https://packagist.org/packages/'.$package->name.'.json'); $versions = json_decode($versions); - foreach ($versions->package->versions as $version => $package) { - $packages[$package->name] += array($version => $package); + foreach ($versions->package->versions as $v => $package) { + $packages[$package->name] += array($v => $package); } }