Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch '2.3' into 2.4

* 2.3:
  bumped Symfony version to 2.3.10
  updated VERSION for 2.3.9
  update CONTRIBUTORS for 2.3.9
  updated CHANGELOG for 2.3.9
  Add support SAPI cli-server
  Fix hardcoded listenerTag name in error message
  [HttpFoundation] Documented public properties.
  [Routing] add missing unit tests for Route and RouteCollection classes

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Routing/Tests/RouteCollectionTest.php
  • Loading branch information...
commit 8cc2414c9695931bfb0387f5056a996533c7efd8 2 parents e5629d7 + e7df0cf
@fabpot fabpot authored
View
33 CHANGELOG-2.3.md
@@ -7,6 +7,39 @@ in 2.3 minor versions.
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.3.0...v2.3.1
+* 2.3.9 (2014-01-05)
+
+ * bug #9938 [Process] Add support SAPI cli-server (peter-gribanov)
+ * bug #9940 [EventDispatcher] Fix hardcoded listenerTag name in error message (lemoinem)
+ * bug #9908 [HttpFoundation] Throw proper exception when invalid data is passed to JsonResponse class (stloyd)
+ * bug #9902 [Security] fixed pre/post authentication checks (fabpot)
+ * bug #9899 [Filesystem | WCM] 9339 fix stat on url for filesystem copy (cordoval)
+ * bug #9589 [DependencyInjection] Fixed #9020 - Added support for collections in service#parameters (lavoiesl)
+ * bug #9889 [Console] fixed column width when using the Table helper with some decoration in cells (fabpot)
+ * bug #9323 [DomCrawler]fix #9321 Crawler::addHtmlContent add gbk encoding support (bronze1man)
+ * bug #8997 [Security] Fixed problem with losing ROLE_PREVIOUS_ADMIN role. (pawaclawczyk)
+ * bug #9557 [DoctrineBridge] Fix for cache-key conflict when having a \Traversable as choices (DRvanR)
+ * bug #9879 [Security] Fix ExceptionListener to catch correctly AccessDeniedException if is not first exception (fabpot)
+ * bug #9885 [Dependencyinjection] Fixed handling of inlined references in the AnalyzeServiceReferencesPass (fabpot)
+ * bug #9884 [DomCrawler] Fixed creating form objects from named form nodes (jakzal)
+ * bug #9882 Add support for HHVM in the getting of the PHP executable (fabpot)
+ * bug #9850 [Validator] Fixed IBAN validator with 0750447346 value (stewe)
+ * bug #9865 [Validator] Fixes message value for objects (jongotlin)
+ * bug #9441 [Form][DateTimeToArrayTransformer] Check for hour, minute & second validity (egeloen)
+ * bug #9867 #9866 [Filesystem] Fixed mirror for symlinks (COil)
+ * bug #9806 [Security] Fix parent serialization of user object (ddeboer)
+ * bug #9834 [DependencyInjection] Fixed support for backslashes in service ids. (jakzal)
+ * bug #9826 fix #9356 [Security] Logger should manipulate the user reloaded from provider (matthieuauger)
+ * bug #9769 [BrowserKit] fixes #8311 CookieJar is totally ignorant of RFC 6265 edge cases (jzawadzki)
+ * bug #9697 [Config] fix 5528 let ArrayNode::normalizeValue respect order of value array provided (cordoval)
+ * bug #9701 [Config] fix #7243 allow 0 as arraynode name (cordoval)
+ * bug #9795 [Form] Fixed issue in BaseDateTimeTransformer when invalid timezone cause Trans... (tyomo4ka)
+ * bug #9714 [HttpFoundation] BinaryFileResponse should also return 416 or 200 on some range-requets (SimonSimCity)
+ * bug #9601 [Routing] Remove usage of deprecated _scheme requirement (Danez)
+ * bug #9489 [DependencyInjection] Add normalization to tag options (WouterJ)
+ * bug #9135 [Form] [Validator] fix maxLength guesser (franek)
+ * bug #9790 [Filesystem] Changed the mode for a target file in copy() to be write only (jakzal)
+
* 2.3.8 (2013-12-16)
* bug #9758 [Console] fixed TableHelper when cell value has new line (k-przybyszewski)
View
85 CONTRIBUTORS.md
@@ -16,8 +16,8 @@ Symfony2 is the result of the work of many people who made the code better
- Karma Dordrak (drak)
- Ryan Weaver (weaverryan)
- Lukas Kahwe Smith (lsmith)
- - Joseph Bielawski (stloyd)
- Jakub Zalas (jakubzalas)
+ - Joseph Bielawski (stloyd)
- Jeremy Mikola (jmikola)
- Jean-François Simon (jfsimon)
- Benjamin Eberlei (beberlei)
@@ -37,10 +37,10 @@ Symfony2 is the result of the work of many people who made the code better
- Miha Vrhovnik
- Henrik Bjørnskov (henrikbjorn)
- Konstantin Kudryashov (everzet)
- - Florin Patan (florinpatan)
- Bilal Amarni (bamarni)
- - Saša Stamenković (umpirsky)
+ - Florin Patan (florinpatan)
- Grégoire Pineau (lyrixx)
+ - Saša Stamenković (umpirsky)
- hhamon
- Eric Clemmons (ericclemmons)
- Deni
@@ -48,6 +48,7 @@ Symfony2 is the result of the work of many people who made the code better
- Dariusz Górecki (canni)
- Arnout Boks (aboks)
- Andrej Hudec (pulzarraider)
+ - Wouter De Jong (wouterj)
- Lee McDermott
- Brandon Turner
- Daniel Holmes (dholmes)
@@ -56,46 +57,48 @@ Symfony2 is the result of the work of many people who made the code better
- John Wards (johnwards)
- Fran Moreno (franmomu)
- Bart van den Burg (burgov)
+ - Christian Raue
- Antoine Hérault (herzult)
- Toni Uebernickel (havvg)
- - Christian Raue
- Michel Weimerskirch (mweimerskirch)
+ - Brice BERNARD (brikou)
- Arnaud Le Blanc (arnaud-lb)
- marc.weistroff
- - Brice BERNARD (brikou)
- lenar
- Tim Nagel (merk)
- Włodzimierz Gajda (gajdaw)
+ - Kevin Bond (kbond)
- Colin Frei
- excelwebzone
- - Wouter De Jong (wouterj)
- - Kevin Bond (kbond)
- Fabien Pennequin (fabienpennequin)
- Jacob Dreesen (jdreesen)
- Adrien Brault (adrienbrault)
- Michal Piotrowski (eventhorizon)
+ - Luis Cordova (cordoval)
- Robert Schönthal (digitalkaoz)
- Juti Noppornpitak (shiroyuki)
- Sebastian Hörl (blogsh)
- Hidenori Goto (hidenorigoto)
- Gábor Egyed (1ed)
- David Buchmann (dbu)
+ - Ait Boudad Abdellatif (aitboudad)
- Daniel Gomes (danielcsgomes)
- Peter Kokot (maastermedia)
- Jérémie Augustin (jaugustin)
- Tigran Azatyan (tigranazatyan)
+ - Javier Eguiluz (javier.eguiluz)
- Rafael Dohms (rdohms)
- Richard Shank (iampersistent)
- Gordon Franke (gimler)
- Helmer Aaviksoo
- - Javier Eguiluz (javier.eguiluz)
- Matthieu Ouellette-Vachon (maoueh)
- Michał Pipa (michal.pipa)
- Amal Raghav (kertz)
- Jonathan Ingram (jonathaningram)
- Artur Kotyrba
- - Ait Boudad Abdellatif (aitboudad)
- Pablo Godel (pgodel)
+ - Eric GELOEN (gelo)
+ - Jérôme Tamarelle (gromnan)
- Sebastiaan Stok (sstok)
- Dmitrii Chekaliuk (lazyhammer)
- Clément JOBEILI (dator)
@@ -105,11 +108,10 @@ Symfony2 is the result of the work of many people who made the code better
- Arnaud Kleinpeter (nanocom)
- Mario A. Alvarez Garcia (nomack84)
- Dennis Benkert (denderello)
- - Eric GELOEN (gelo)
- Benjamin Dulau (dbenjamin)
- Andreas Hucks (meandmymonkey)
- Noel Guilbert (noel)
- - Jérôme Tamarelle (gromnan)
+ - bronze1man
- Larry Garfield (crell)
- Guilherme Blanco (guilhermeblanco)
- Martin Schuhfuß (usefulthink)
@@ -118,6 +120,7 @@ Symfony2 is the result of the work of many people who made the code better
- Pierre Minnieur (pminnieur)
- fivestar
- Dominique Bongiraud
+ - Rouven Weßling (realityking)
- Leszek Prabucki (l3l0)
- François Zaninotto (fzaninotto)
- Dustin Whittle (dustinwhittle)
@@ -139,6 +142,7 @@ Symfony2 is the result of the work of many people who made the code better
- Katsuhiro OGAWA
- Andréia Bohner (andreia)
- Alif Rachmawadi
+ - Matthias Pigulla (mpdude)
- Joseph Rouff (rouffj)
- Félix Labrecque (woodspire)
- Christian Flothmann (xabbuh)
@@ -155,11 +159,10 @@ Symfony2 is the result of the work of many people who made the code better
- Kim Hemsø Rasmussen
- Wouter Van Hecke
- Michael Holm (hollo)
+ - Peter Rehm (rpet)
- Marc Weistroff (futurecat)
- - bronze1man
- Roman Marintšenko (inori)
- Florian Klein (docteurklein)
- - Matthias Pigulla (mpdude)
- Manuel Kiessling (manuelkiessling)
- Bertrand Zuchuat (garfield-fr)
- Gabor Toth (tgabi333)
@@ -170,12 +173,13 @@ Symfony2 is the result of the work of many people who made the code better
- Aurelijus Valeiša (aurelijus)
- Gustavo Piltcher
- Stepan Tanasiychuk (stfalcon)
- - Luis Cordova (cordoval)
- Bob den Otter (bopp)
- Adrian Rudnik (kreischweide)
- Francesc Rosàs (frosas)
+ - Julien Galenski (ruian)
- Bongiraud Dominique
- janschoenherr
+ - Marco Pivetta (ocramius)
- Ricard Clau (ricardclau)
- Erin Millard
- Matthew Lewinski (lewinski)
@@ -193,6 +197,7 @@ Symfony2 is the result of the work of many people who made the code better
- Terje Bråten
- Kristen Gilden (kgilden)
- hossein zolfi (ocean)
+ - giulio de donato (liuggio)
- Philipp Kräutli (pkraeutli)
- Kirill chEbba Chebunin (chebba)
- Greg Thornton (xdissent)
@@ -200,6 +205,7 @@ Symfony2 is the result of the work of many people who made the code better
- sun (sun)
- Lars Strojny
- Costin Bereveanu (schniper)
+ - Loïc Chardonnet (gnusat)
- realmfoo
- Tamas Szijarto
- Pavel Volokitin (pvolok)
@@ -209,6 +215,7 @@ Symfony2 is the result of the work of many people who made the code better
- Joe Lencioni
- Chekote
- Kai
+ - Stefano Sala (stefano.sala)
- Xavier HAUSHERR
- Albert Jessurum (ajessu)
- Laszlo Korte
@@ -219,13 +226,12 @@ Symfony2 is the result of the work of many people who made the code better
- Oscar Cubo Medina (ocubom)
- Karel Souffriau
- Christophe L. (christophelau)
- - Julien Galenski (ruian)
- Jáchym Toušek
- Emanuele Gaspari (inmarelibero)
- Brian King
- Michel Salib (michelsalib)
- geoffrey
- - Marco Pivetta (ocramius)
+ - Florian Voutzinos (florianv)
- Nikita Konstantinov
- Jeanmonod David (jeanmonod)
- Jan Schumann
@@ -234,6 +240,7 @@ Symfony2 is the result of the work of many people who made the code better
- lancergr
- Antonio J. García Lagar (ajgarlag)
- Olivier Dolbeau (odolbeau)
+ - Daniel Tschinder
- alquerci
- vagrant
- Asier Illarramendi (doup)
@@ -241,20 +248,20 @@ Symfony2 is the result of the work of many people who made the code better
- Vitaliy Tverdokhlib (vitaliytv)
- Dirk Pahl (dirkaholic)
- Jonas Flodén (flojon)
+ - Sébastien Lavoie (lavoiesl)
- Marcin Sikoń (marphi)
+ - franek (franek)
- Adam Harvey
- boombatower
- Fabrice Bernhard (fabriceb)
- Fabian Lange (codingfabian)
- Yoshio HANAWA
- - Peter Rehm
- Sebastian Bergmann
- Pablo Díez (pablodip)
- Kevin McBride
- Manuel de Ruiter (manuel)
- Jérémy Romey (jeremyfreeagent)
- Eduardo Oliveira (entering)
- - Loïc Chardonnet (gnusat)
- Iker Ibarguren (ikerib)
- Ricardo Oliveira (ricardolotr)
- ondrowan
@@ -276,7 +283,6 @@ Symfony2 is the result of the work of many people who made the code better
- sasezaki
- Denis Gorbachev (starfall)
- Steven Surowiec
- - giulio de donato (liuggio)
- Marek Kalnik (marekkalnik)
- Chris Smith
- Anthon Pang
@@ -314,6 +320,7 @@ Symfony2 is the result of the work of many people who made the code better
- Dustin Dobervich (dustin10)
- Sebastian Marek (proofek)
- Erkhembayar Gantulga (erheme318)
+ - Kamil Kokot (pamil)
- Rostyslav Kinash
- Vincent Simonin
- Stefan Warman
@@ -324,24 +331,28 @@ Symfony2 is the result of the work of many people who made the code better
- Chris Heng (gigablah)
- Antoine Corcy
- cedric lombardot (cedriclombardot)
- - franek (franek)
- John Kary (johnkary)
- François-Xavier de Guillebon (de-gui_f)
- Hossein Bukhamsin
+ - Paweł Wacławczyk (pwc)
- Oleg Zinchenko (cystbear)
- Diego Saint Esteben (dii3g0)
- Johannes Klauss (cloppy)
+ - Evan Villemez
- fzerorubigd
- Tiago Brito (blackmx)
- develop
- Tomasz Kowalczyk (thunderer)
- Mark Sonnabaum
- Filippo Tessarotto
+ - Arturas Smorgun (asarturas)
+ - Alexander Volochnev (exelenz)
- Michael Piecko
- yclian
- Pascal Helfenstein
- Baldur Rensch (brensch)
- Alex Xandra Albert Sim
+ - florianv
- Yuen-Chi Lian
- Besnik Br
- Joshua Nye
@@ -350,7 +361,6 @@ Symfony2 is the result of the work of many people who made the code better
- Lars Vierbergen
- Mark Challoner
- Andrew Tchircoff (andrewtch)
- - Daniel Tschinder
- michaelwilliams
- Leevi Graham (leevigraham)
- Casper Valdemar Poulsen
@@ -377,7 +387,6 @@ Symfony2 is the result of the work of many people who made the code better
- Thomas Ploch (tploch)
- Reen Lokum
- Martin Parsiegla (spea)
- - Stefano Sala (stefano.sala)
- Pierre Vanliefland (pvanliefland)
- frost-nzcr4
- Abhoryo
@@ -421,6 +430,7 @@ Symfony2 is the result of the work of many people who made the code better
- Maks
- Gábor Tóth
- Daniel Cestari
+ - Philipp Rieber (bicpi)
- Magnus Nordlander (magnusnordlander)
- Mikhail Yurasov (mym)
- Florian Rey (nervo)
@@ -442,6 +452,7 @@ Symfony2 is the result of the work of many people who made the code better
- ttomor
- Mei Gwilym (meigwilym)
- Luciano Mammino (loige)
+ - fabios
- Sander Coolen (scoolen)
- Nicolas Le Goff (nlegoff)
- Manuele Menozzi
@@ -461,10 +472,10 @@ Symfony2 is the result of the work of many people who made the code better
- Alex Bogomazov
- julien.galenski
- Christian Schmidt
- - Sébastien Lavoie (lavoiesl)
- Per Sandström (per)
- Lin Clark
- Jeremy David (jeremy.david)
+ - Florian Lonqueu-Brochard (florianlb)
- Troy McCabe
- Ville Mattila
- Ben Davies
@@ -475,9 +486,11 @@ Symfony2 is the result of the work of many people who made the code better
- Marcos Quesada (marcos_quesada)
- Dan Finnie
- Ken Marfilla (marfillaster)
+ - benatespina (benatespina)
- jfcixmedia
- Martijn Evers
- Benjamin Paap (benjaminpaap)
+ - Simon Schick (simonsimcity)
- Christian
- Sergii Smertin (nfx)
- Eddie Jaoude
@@ -495,27 +508,34 @@ Symfony2 is the result of the work of many people who made the code better
- Benoit Garret
- DerManoMann
- Roland Franssen (ro0)
+ - Mathieu Lemoine
+ - Rodrigo Díez Villamuera (rodrigodiez)
- Jochen Bayer (jocl)
- Jeremy Bush
- - Evan Villemez
- Péter Buri (burci)
- Davide Borsatto (davide.borsatto)
- kaiwa
- Albert Ganiev (helios-ag)
- Neil Katin
- peter
+ - Artem Kolesnikov (tyomo4ka)
- Gustavo Adrian
- Clément Gautier (clementgautier)
+ - David de Boer (ddeboer)
- Brooks Boyd
- Roger Webb
- Nicolas Fabre (nfabre)
- Raul Rodriguez (raul782)
+ - Derek Lambert
- Felicitus
+ - Krzysztof Przybyszewski
- Paul Matthews
- Juan Traverso
+ - Jerzy Zawadzki
- Philipp Strube
- Christian Sciberras
- Clement Herreman (clemherreman)
+ - Trent Steel (trsteel88)
- Marco
- Alberto Aldegheri
- heccjj
@@ -525,6 +545,7 @@ Symfony2 is the result of the work of many people who made the code better
- Mo Di (modi)
- Richard van den Brand (ricbra)
- Quique Porta (quiqueporta)
+ - Tomasz Szymczyk (karion)
- Aharon Perkel
- Malaney J. Hill
- Cédric Girard (enk_)
@@ -539,6 +560,7 @@ Symfony2 is the result of the work of many people who made the code better
- Daniel Wehner
- Saem Ghani
- Sebastian Utz
+ - Karol Sójko (karolsojko)
- Sébastien HOUZÉ
- Samy Dindane (dinduks)
- Keri Henare (kerihenare)
@@ -550,6 +572,7 @@ Symfony2 is the result of the work of many people who made the code better
- George Giannoulopoulos
- Daniel Richter (richtermeister)
- Chris Wilkinson (thewilkybarkid)
+ - ChrisC
- Ilya Biryukov
- Jason Desrosiers
- m.chwedziak
@@ -559,6 +582,7 @@ Symfony2 is the result of the work of many people who made the code better
- Matt Daum (daum)
- Alberto Pirovano (geezmo)
- Martin Pärtel
+ - Evgeniy (ewgraf)
- Xavier Briand (xavierbriand)
- WedgeSama
- Romain Geissler
@@ -575,6 +599,7 @@ Symfony2 is the result of the work of many people who made the code better
- Sebastian Krebs
- Rick Prent
- Martin Eckhardt
+ - Jon Gotlin (jongotlin)
- Michael Dowling (mtdowling)
- Nicolas Grekas (nicolas-grekas)
- BilgeXA
@@ -588,6 +613,7 @@ Symfony2 is the result of the work of many people who made the code better
- fdgdfg (psampaz)
- Maxwell Vandervelde
- kaywalker
+ - Mike Meier
- Sebastian Ionescu
- Simon Neidhold
- Kevin Dew
@@ -625,7 +651,6 @@ Symfony2 is the result of the work of many people who made the code better
- Francisco Facioni (fran6co)
- Iwan van Staveren (istaveren)
- Povilas S. (povilas)
- - Paweł Wacławczyk (pwc)
- pborreli
- Eric Caron
- 2manypeople
@@ -678,8 +703,10 @@ Symfony2 is the result of the work of many people who made the code better
- Artyom Protaskin
- Nathanael d. Noblet
- helmer
+ - Daan van Renterghem
- Bram Van der Sype (brammm)
- Julien Moulin (lizjulien)
+ - Matthieu Auger (matthieuauger)
- dened
- devel
- gedrox
@@ -693,6 +720,7 @@ Symfony2 is the result of the work of many people who made the code better
- tante kinast (tante)
- Alexander Zogheb
- Florian Pfitzer
+ - Joel Marcey
- David Christmann
- root
- Tom Maguire
@@ -704,7 +732,6 @@ Symfony2 is the result of the work of many people who made the code better
- Julien DIDIER (juliendidier)
- Martin Mayer (martin)
- Grzegorz Łukaszewicz (newicz)
- - Rouven Weßling (realityking)
- Robert Campbell
- Matt Lehner
- Alex Pods
@@ -731,9 +758,11 @@ Symfony2 is the result of the work of many people who made the code better
- Rafał
- Masao Maeda (brtriver)
- Dave Marshall (davedevelopment)
+ - David Joos (djoos)
- Denis Klementjev (dklementjev)
- Kévin Dunglas (dunglas)
- Vincent Composieux (eko)
+ - gondo (gondo)
- Osman Üngür (import)
- Jorge Martin (jorgemartind)
- Kevin Herrera (kherge)
@@ -775,8 +804,10 @@ Symfony2 is the result of the work of many people who made the code better
- Sylvain Lorinet
- jc
- BenjaminBeck
+ - Aurelijus Rožėnas
- Christian Eikermann
- Antonio Angelino
+ - Quentin Schuler
- Vladimir Sazhin
- jamogon
- Vyacheslav Slinko
@@ -820,7 +851,6 @@ Symfony2 is the result of the work of many people who made the code better
- dinitrol
- Penny Leach
- oscartv
- - Philipp Rieber
- DanSync
- Peter Zwosta
- parhs
@@ -841,6 +871,7 @@ Symfony2 is the result of the work of many people who made the code better
- Chris Sedlmayr (catchamonkey)
- Kousuke Ebihara (co3k)
- Cas Leentfaar (codeklopper)
+ - Loïc Vernet (coil)
- Christoph Schaefer (cvschaefer)
- Damien Alexandre (damienalexandre)
- Damon Jones (damon__jones)
View
14 src/Symfony/Component/HttpFoundation/Request.php
@@ -64,6 +64,8 @@ class Request
protected static $httpMethodParameterOverride = false;
/**
+ * Custom parameters
+ *
* @var \Symfony\Component\HttpFoundation\ParameterBag
*
* @api
@@ -71,6 +73,8 @@ class Request
public $attributes;
/**
+ * Request body parameters ($_POST)
+ *
* @var \Symfony\Component\HttpFoundation\ParameterBag
*
* @api
@@ -78,6 +82,8 @@ class Request
public $request;
/**
+ * Query string parameters ($_GET)
+ *
* @var \Symfony\Component\HttpFoundation\ParameterBag
*
* @api
@@ -85,6 +91,8 @@ class Request
public $query;
/**
+ * Server and execution environment parameters ($_SERVER)
+ *
* @var \Symfony\Component\HttpFoundation\ServerBag
*
* @api
@@ -92,6 +100,8 @@ class Request
public $server;
/**
+ * Uploaded files ($_FILES)
+ *
* @var \Symfony\Component\HttpFoundation\FileBag
*
* @api
@@ -99,6 +109,8 @@ class Request
public $files;
/**
+ * Cookies ($_COOKIE)
+ *
* @var \Symfony\Component\HttpFoundation\ParameterBag
*
* @api
@@ -106,6 +118,8 @@ class Request
public $cookies;
/**
+ * Headers (taken from the $_SERVER)
+ *
* @var \Symfony\Component\HttpFoundation\HeaderBag
*
* @api
View
2  src/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php
@@ -70,7 +70,7 @@ public function process(ContainerBuilder $container)
$priority = isset($event['priority']) ? $event['priority'] : 0;
if (!isset($event['event'])) {
- throw new \InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "kernel.event_listener" tags.', $id));
+ throw new \InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "%s" tags.', $id, $this->listenerTag));
}
if (!isset($event['method'])) {
View
2  src/Symfony/Component/Process/PhpExecutableFinder.php
@@ -39,7 +39,7 @@ public function find()
}
// PHP_BINARY return the current sapi executable
- if (defined('PHP_BINARY') && PHP_BINARY && ('cli' === PHP_SAPI) && is_file(PHP_BINARY)) {
+ if (defined('PHP_BINARY') && PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server')) && is_file(PHP_BINARY)) {
return PHP_BINARY;
}
View
43 src/Symfony/Component/Routing/Tests/RouteCollectionTest.php
@@ -258,4 +258,47 @@ public function testSetCondition()
$this->assertEquals('context.getMethod() == "POST"', $routea->getCondition());
$this->assertEquals('context.getMethod() == "POST"', $routeb->getCondition());
}
+
+ public function testClone()
+ {
+ $collection = new RouteCollection();
+ $collection->add('a', new Route('/a'));
+ $collection->add('b', new Route('/b', array('placeholder' => 'default'), array('placeholder' => '.+')));
+
+ $clonedCollection = clone $collection;
+
+ $this->assertCount(2, $clonedCollection);
+ $this->assertEquals($collection->get('a'), $clonedCollection->get('a'));
+ $this->assertNotSame($collection->get('a'), $clonedCollection->get('a'));
+ $this->assertEquals($collection->get('b'), $clonedCollection->get('b'));
+ $this->assertNotSame($collection->get('b'), $clonedCollection->get('b'));
+ }
+
+ public function testSetSchemes()
+ {
+ $collection = new RouteCollection();
+ $routea = new Route('/a', array(), array(), array(), '', 'http');
+ $routeb = new Route('/b');
+ $collection->add('a', $routea);
+ $collection->add('b', $routeb);
+
+ $collection->setSchemes(array('http', 'https'));
+
+ $this->assertEquals(array('http', 'https'), $routea->getSchemes());
+ $this->assertEquals(array('http', 'https'), $routeb->getSchemes());
+ }
+
+ public function testSetMethods()
+ {
+ $collection = new RouteCollection();
+ $routea = new Route('/a', array(), array(), array(), '', array(), array('GET', 'POST'));
+ $routeb = new Route('/b');
+ $collection->add('a', $routea);
+ $collection->add('b', $routeb);
+
+ $collection->setMethods('PUT');
+
+ $this->assertEquals(array('PUT'), $routea->getMethods());
+ $this->assertEquals(array('PUT'), $routeb->getMethods());
+ }
}
View
33 src/Symfony/Component/Routing/Tests/RouteTest.php
@@ -63,6 +63,15 @@ public function testOptions()
$this->assertEquals(array('foo' => 'foo', 'bar' => 'bar', 'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler'), $route->getOptions(), '->addDefaults() keep previous defaults');
}
+ public function testOption()
+ {
+ $route = new Route('/{foo}');
+ $this->assertFalse($route->hasOption('foo'), '->hasOption() return false if option is not set');
+ $this->assertEquals($route, $route->setOption('foo', 'bar'), '->setOption() implements a fluent interface');
+ $this->assertEquals('bar', $route->getOption('foo'), '->setOption() sets the option');
+ $this->assertTrue($route->hasOption('foo'), '->hasOption() return true if option is set');
+ }
+
public function testDefaults()
{
$route = new Route('/{foo}');
@@ -75,7 +84,7 @@ public function testDefaults()
$route->setDefault('foo2', 'bar2');
$this->assertEquals('bar2', $route->getDefault('foo2'), '->getDefault() return the default value');
- $this->assertNull($route->getDefault('not_defined'), '->getDefault() return null if default value is not setted');
+ $this->assertNull($route->getDefault('not_defined'), '->getDefault() return null if default value is not set');
$route->setDefault('_controller', $closure = function () { return 'Hello'; });
$this->assertEquals($closure, $route->getDefault('_controller'), '->setDefault() sets a default value');
@@ -106,8 +115,10 @@ public function testRequirements()
public function testRequirement()
{
$route = new Route('/{foo}');
+ $this->assertFalse($route->hasRequirement('foo'), '->hasRequirement() return false if requirement is not set');
$route->setRequirement('foo', '^\d+$');
$this->assertEquals('\d+', $route->getRequirement('foo'), '->setRequirement() removes ^ and $ from the path');
+ $this->assertTrue($route->hasRequirement('foo'), '->hasRequirement() return true if requirement is set');
}
/**
@@ -206,4 +217,24 @@ public function testCompile()
$route->setRequirement('foo', '.*');
$this->assertNotSame($compiled, $route->compile(), '->compile() recompiles if the route was modified');
}
+
+ public function testPattern()
+ {
+ $route = new Route('/{foo}');
+ $this->assertEquals('/{foo}', $route->getPattern());
+
+ $route->setPattern('/bar');
+ $this->assertEquals('/bar', $route->getPattern());
+ }
+
+ public function testSerialize()
+ {
+ $route = new Route('/{foo}', array('foo' => 'default'), array('foo' => '\d+'));
+
+ $serialized = serialize($route);
+ $unserialized = unserialize($serialized);
+
+ $this->assertEquals($route, $unserialized);
+ $this->assertNotSame($route, $unserialized);
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.