Merge branch '2.8' into 3.0
* 2.8: [travis] Fix deps=low/high builds fixed CS skip test with current phpunit bridge Fix for #19183 to add support for new PHP MongoDB extension in sessions. [Console] Fix for block() padding formatting after #19189 [Security][Guard] check if session exist before using it bumped Symfony version to 2.8.9 updated VERSION for 2.8.8 updated CHANGELOG for 2.8.8 bumped Symfony version to 2.7.16 updated VERSION for 2.7.15 update CONTRIBUTORS for 2.7.15 updated CHANGELOG for 2.7.15 Fix some lowest deps Fixed typos in the expectedException annotations Conflicts: CHANGELOG-2.7.md CHANGELOG-3.0.md src/Symfony/Bundle/FrameworkBundle/composer.json src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/HttpKernel/composer.json src/Symfony/Component/Yaml/Tests/ParserTest.php
This commit is contained in:
commit
58c8b71320
4
.github/travis.php
vendored
4
.github/travis.php
vendored
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
|
||||
|
||||
// ensure that block() output is properly formatted (even padding lines)
|
||||
return function (InputInterface $input, OutputInterface $output) {
|
||||
$output->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'
|
||||
);
|
||||
};
|
@ -0,0 +1,8 @@
|
||||
|
||||
[30;42m [39;49m
|
||||
[30;42m [OK] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore [39;49m
|
||||
[30;42m magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo [39;49m
|
||||
[30;42m consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. [39;49m
|
||||
[30;42m Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum [39;49m
|
||||
[30;42m [39;49m
|
||||
|
@ -58,6 +58,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 () {
|
||||
|
@ -19,7 +19,7 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
|
||||
class MongoDbSessionHandler implements \SessionHandlerInterface
|
||||
{
|
||||
/**
|
||||
* @var \Mongo
|
||||
* @var \Mongo|\MongoClient|\MongoDB\Client
|
||||
*/
|
||||
private $mongo;
|
||||
|
||||
@ -61,7 +61,7 @@ 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 \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
|
||||
@ -69,7 +69,7 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -179,10 +201,30 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
|
||||
/**
|
||||
* Return a Mongo instance.
|
||||
*
|
||||
* @return \Mongo
|
||||
* @return \Mongo|\MongoClient|\MongoDB\Client
|
||||
*/
|
||||
protected function getMongo()
|
||||
{
|
||||
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 (null === $seconds) {
|
||||
$seconds = time();
|
||||
}
|
||||
|
||||
if ($this->mongo instanceof \MongoDB\Client) {
|
||||
return new \MongoDB\BSON\UTCDateTime($seconds * 1000);
|
||||
}
|
||||
|
||||
return new \MongoDate($seconds);
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
* file this was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpFoundation\Tests\Session\Storage\Handler;
|
||||
@ -15,7 +15,6 @@ use Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandl
|
||||
|
||||
/**
|
||||
* @author Markus Bachmann <markus.bachmann@bachi.biz>
|
||||
* @requires extension mongo
|
||||
* @group time-sensitive
|
||||
*/
|
||||
class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
@ -31,7 +30,15 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
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()
|
||||
@ -96,14 +103,28 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertArrayHasKey($this->options['expiry_field'], $criteria);
|
||||
$this->assertArrayHasKey('$gte', $criteria[$this->options['expiry_field']]);
|
||||
|
||||
if (phpversion('mongodb')) {
|
||||
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $criteria[$this->options['expiry_field']]['$gte']);
|
||||
$this->assertGreaterThanOrEqual(round(intval((string) $criteria[$this->options['expiry_field']]['$gte']) / 1000), $testTimeout);
|
||||
} else {
|
||||
$this->assertInstanceOf('MongoDate', $criteria[$this->options['expiry_field']]['$gte']);
|
||||
$this->assertGreaterThanOrEqual($criteria[$this->options['expiry_field']]['$gte']->sec, $testTimeout);
|
||||
}
|
||||
|
||||
return array(
|
||||
$fields = array(
|
||||
$this->options['id_field'] => 'foo',
|
||||
$this->options['data_field'] => new \MongoBinData('bar', \MongoBinData::BYTE_ARRAY),
|
||||
$this->options['id_field'] => new \MongoDate(),
|
||||
);
|
||||
|
||||
if (phpversion('mongodb')) {
|
||||
$fields[$this->options['data_field']] = new \MongoDB\BSON\Binary('bar', \MongoDB\BSON\Binary::TYPE_OLD_BINARY);
|
||||
$fields[$this->options['id_field']] = new \MongoDB\BSON\UTCDateTime(time() * 1000);
|
||||
} else {
|
||||
$fields[$this->options['data_field']] = new \MongoBinData('bar', \MongoBinData::BYTE_ARRAY);
|
||||
$fields[$this->options['id_field']] = new \MongoDate();
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}));
|
||||
|
||||
$this->assertEquals('bar', $this->storage->read('foo'));
|
||||
@ -120,11 +141,18 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$data = array();
|
||||
|
||||
$methodName = phpversion('mongodb') ? 'updateOne' : 'update';
|
||||
|
||||
$collection->expects($this->once())
|
||||
->method('update')
|
||||
->method($methodName)
|
||||
->will($this->returnCallback(function ($criteria, $updateData, $options) use (&$data) {
|
||||
$this->assertEquals(array($this->options['id_field'] => 'foo'), $criteria);
|
||||
|
||||
if (phpversion('mongodb')) {
|
||||
$this->assertEquals(array('upsert' => true), $options);
|
||||
} else {
|
||||
$this->assertEquals(array('upsert' => true, 'multiple' => false), $options);
|
||||
}
|
||||
|
||||
$data = $updateData['$set'];
|
||||
}));
|
||||
@ -132,11 +160,18 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
$expectedExpiry = time() + (int) ini_get('session.gc_maxlifetime');
|
||||
$this->assertTrue($this->storage->write('foo', 'bar'));
|
||||
|
||||
if (phpversion('mongodb')) {
|
||||
$this->assertEquals('bar', $data[$this->options['data_field']]->getData());
|
||||
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$this->options['time_field']]);
|
||||
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$this->options['expiry_field']]);
|
||||
$this->assertGreaterThanOrEqual($expectedExpiry, round(intval((string) $data[$this->options['expiry_field']]) / 1000));
|
||||
} else {
|
||||
$this->assertEquals('bar', $data[$this->options['data_field']]->bin);
|
||||
$this->assertInstanceOf('MongoDate', $data[$this->options['time_field']]);
|
||||
$this->assertInstanceOf('MongoDate', $data[$this->options['expiry_field']]);
|
||||
$this->assertGreaterThanOrEqual($expectedExpiry, $data[$this->options['expiry_field']]->sec);
|
||||
}
|
||||
}
|
||||
|
||||
public function testWriteWhenUsingExpiresField()
|
||||
{
|
||||
@ -160,21 +195,34 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$data = array();
|
||||
|
||||
$methodName = phpversion('mongodb') ? 'updateOne' : 'update';
|
||||
|
||||
$collection->expects($this->once())
|
||||
->method('update')
|
||||
->method($methodName)
|
||||
->will($this->returnCallback(function ($criteria, $updateData, $options) use (&$data) {
|
||||
$this->assertEquals(array($this->options['id_field'] => 'foo'), $criteria);
|
||||
|
||||
if (phpversion('mongodb')) {
|
||||
$this->assertEquals(array('upsert' => true), $options);
|
||||
} else {
|
||||
$this->assertEquals(array('upsert' => true, 'multiple' => false), $options);
|
||||
}
|
||||
|
||||
$data = $updateData['$set'];
|
||||
}));
|
||||
|
||||
$this->assertTrue($this->storage->write('foo', 'bar'));
|
||||
|
||||
if (phpversion('mongodb')) {
|
||||
$this->assertEquals('bar', $data[$this->options['data_field']]->getData());
|
||||
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$this->options['time_field']]);
|
||||
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$this->options['expiry_field']]);
|
||||
} else {
|
||||
$this->assertEquals('bar', $data[$this->options['data_field']]->bin);
|
||||
$this->assertInstanceOf('MongoDate', $data[$this->options['time_field']]);
|
||||
$this->assertInstanceOf('MongoDate', $data[$this->options['expiry_field']]);
|
||||
}
|
||||
}
|
||||
|
||||
public function testReplaceSessionData()
|
||||
{
|
||||
@ -187,8 +235,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;
|
||||
}));
|
||||
@ -196,8 +246,12 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->storage->write('foo', 'bar');
|
||||
$this->storage->write('foo', 'foobar');
|
||||
|
||||
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()
|
||||
{
|
||||
@ -208,8 +262,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'));
|
||||
@ -224,11 +280,18 @@ 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)
|
||||
->will($this->returnCallback(function ($criteria) {
|
||||
if (phpversion('mongodb')) {
|
||||
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $criteria[$this->options['expiry_field']]['$lt']);
|
||||
$this->assertGreaterThanOrEqual(time() - 1, round(intval((string) $criteria[$this->options['expiry_field']]['$lt']) / 1000));
|
||||
} else {
|
||||
$this->assertInstanceOf('MongoDate', $criteria[$this->options['expiry_field']]['$lt']);
|
||||
$this->assertGreaterThanOrEqual(time() - 1, $criteria[$this->options['expiry_field']]['$lt']->sec);
|
||||
}
|
||||
}));
|
||||
|
||||
$this->assertTrue($this->storage->gc(1));
|
||||
@ -239,14 +302,23 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
$method = new \ReflectionMethod($this->storage, 'getMongo');
|
||||
$method->setAccessible(true);
|
||||
|
||||
$mongoClass = (version_compare(phpversion('mongo'), '1.3.0', '<')) ? '\Mongo' : '\MongoClient';
|
||||
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();
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
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
|
||||
if ($request->getSession() instanceof SessionInterface) {
|
||||
$targetPath = $request->getSession()->get('_security.'.$providerKey.'.target_path');
|
||||
}
|
||||
|
||||
if (!$targetPath) {
|
||||
$targetPath = $this->getDefaultSuccessRedirectUrl();
|
||||
|
@ -0,0 +1,212 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\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 <jpasdeloup@sedona.fr>
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user