Merge branch '2.3' into 2.7

* 2.3:
  [ClassLoader] Use symfony/polyfill-apcu
  [HttpFoundation][Cookie] Cookie DateTimeInterface fix
  bumped Symfony version to 2.3.38
  updated VERSION for 2.3.37
  update CONTRIBUTORS for 2.3.37
  updated CHANGELOG for 2.3.37

Conflicts:
	.travis.yml
	src/Symfony/Component/ClassLoader/composer.json
	src/Symfony/Component/HttpKernel/Kernel.php
This commit is contained in:
Nicolas Grekas 2016-01-15 10:26:56 +01:00
commit f9caa244f4
9 changed files with 67 additions and 32 deletions

View File

@ -38,9 +38,10 @@ before_install:
- echo session.gc_probability = 0 >> $INI_FILE
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then echo extension = mongo.so >> $INI_FILE; fi;
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then echo extension = memcache.so >> $INI_FILE; fi;
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.10 && echo apc.enable_cli = 1 >> $INI_FILE) || echo "Let's continue without apcu extension"; fi;
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then pecl install -f memcached-2.1.0 || echo "Let's continue without memcached extension"; fi;
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.10 && echo apc.enable_cli = 1 >> $INI_FILE); fi;
- if [[ $TRAVIS_PHP_VERSION = 7.* ]]; then (echo yes | pecl install -f apcu-5.1.2 && echo apc.enable_cli = 1 >> $INI_FILE); fi;
- if [[ $TRAVIS_PHP_VERSION = 5.* && ! $deps ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> $INI_FILE); fi;
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then pecl install -f memcached-2.1.0; fi;
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi;
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
- if [[ $TRAVIS_REPO_SLUG = symfony/symfony ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;

View File

@ -7,6 +7,21 @@ 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.37 (2016-01-14)
* security #17359 do not ship with a custom rng implementation (xabbuh, fabpot)
* bug #17326 [Console] Display console application name even when no version set (polc)
* bug #17140 [Serializer] Remove normalizer cache in Serializer class (jvasseur)
* bug #17307 [FrameworkBundle] Fix paths with % in it (like urlencoded) (scaytrase)
* bug #17078 [Bridge] [Doctrine] [Validator] Added support \IteratorAggregate for UniqueEntityValidator (Disparity)
* bug #17287 [HttpKernel] Forcing string comparison on query parameters sort in UriSigner (Tim van Densen)
* bug #17278 [FrameworkBundle] Add case in Kernel directory guess for PHPUnit (tgalopin)
* bug #17276 [Process] Fix potential race condition (nicolas-grekas)
* bug #17183 [FrameworkBundle] Set the kernel.name properly after a cache warmup (jakzal)
* bug #17159 [Yaml] recognize when a block scalar is left (xabbuh)
* bug #17195 bug #14246 [Filesystem] dumpFile() non atomic (Hidde Boomsma)
* bug #17177 [Process] Fix potential race condition leading to transient tests (nicolas-grekas)
* 2.3.36 (2015-12-26)
* bug #16864 [Yaml] fix indented line handling in folded blocks (xabbuh)

View File

@ -75,45 +75,45 @@ Symfony is the result of the work of many people who made the code better
- Arnaud Le Blanc (arnaud-lb)
- Tim Nagel (merk)
- Brice BERNARD (brikou)
- Graham Campbell (graham)
- Jérôme Tamarelle (gromnan)
- marc.weistroff
- lenar
- Graham Campbell (graham)
- Włodzimierz Gajda (gajdaw)
- Michal Piotrowski (eventhorizon)
- lenar
- Włodzimierz Gajda (gajdaw)
- Florian Voutzinos (florianv)
- Peter Rehm (rpet)
- Colin Frei
- Dariusz Ruminski
- Adrien Brault (adrienbrault)
- excelwebzone
- Jacob Dreesen (jdreesen)
- Dariusz Ruminski
- Peter Kokot (maastermedia)
- Fabien Pennequin (fabienpennequin)
- Pierre du Plessis (pierredup)
- Alexander Schwenn (xelaris)
- Gordon Franke (gimler)
- Iltar van der Berg (kjarli)
- Robert Schönthal (digitalkaoz)
- Jérémy DERUSSÉ (jderusse)
- Joshua Thijssen
- Stefano Sala (stefano.sala)
- David Buchmann (dbu)
- Issei Murasawa (issei_m)
- Iltar van der Berg (kjarli)
- Juti Noppornpitak (shiroyuki)
- Eric GELOEN (gelo)
- Sebastian Hörl (blogsh)
- Daniel Gomes (danielcsgomes)
- Hidenori Goto (hidenorigoto)
- Vladimir Reznichenko (kalessil)
- Guilherme Blanco (guilhermeblanco)
- Pablo Godel (pgodel)
- Vladimir Reznichenko (kalessil)
- Tigran Azatyan (tigranazatyan)
- Jérémie Augustin (jaugustin)
- Sebastiaan Stok (sstok)
- Rafael Dohms (rdohms)
- Arnaud Kleinpeter (nanocom)
- Alexander M. Turek (derrabus)
- Tigran Azatyan (tigranazatyan)
- Richard Shank (iampersistent)
- Charles Sarrazin (csarrazi)
- Clemens Tolboom
@ -149,6 +149,7 @@ Symfony is the result of the work of many people who made the code better
- sun (sun)
- Larry Garfield (crell)
- Martin Schuhfuß (usefulthink)
- Jáchym Toušek
- Matthieu Bontemps (mbontemps)
- Pierre Minnieur (pminnieur)
- fivestar
@ -166,7 +167,6 @@ Symfony is the result of the work of many people who made the code better
- Rui Marinho (ruimarinho)
- Julien Brochet (mewt)
- Sergey Linnik (linniksa)
- Jáchym Toušek
- Marcel Beerta (mazen)
- Vincent AUBERT (vincent)
- julien pauli (jpauli)
@ -177,6 +177,7 @@ Symfony is the result of the work of many people who made the code better
- Elnur Abdurrakhimov (elnur)
- Manuel Reinhard (sprain)
- Danny Berger (dpb587)
- Diego Saint Esteben (dosten)
- Roman Marintšenko (inori)
- Xavier Montaña Carreras (xmontana)
- Chris Wilkinson (thewilkybarkid)
@ -207,7 +208,6 @@ Symfony is the result of the work of many people who made the code better
- Ruben Gonzalez (rubenrua)
- Marcos Sánchez
- Kim Hemsø Rasmussen (kimhemsoe)
- Diego Saint Esteben (dosten)
- Tom Van Looy (tvlooy)
- Wouter Van Hecke
- Peter Kruithof (pkruithof)
@ -237,6 +237,7 @@ Symfony is the result of the work of many people who made the code better
- Jan Decavele (jandc)
- Gustavo Piltcher
- Stepan Tanasiychuk (stfalcon)
- Titouan Galopin (tgalopin)
- Tiago Ribeiro (fixe)
- Bob den Otter (bopp)
- Adrian Rudnik (kreischweide)
@ -321,6 +322,7 @@ Symfony is the result of the work of many people who made the code better
- Jan Schumann
- Niklas Fiekas
- Mark Challoner (markchalloner)
- Gregor Harlan (gharlan)
- Markus Bachmann (baachi)
- lancergr
- Olivier Dolbeau (odolbeau)
@ -337,6 +339,7 @@ Symfony is the result of the work of many people who made the code better
- cedric lombardot (cedriclombardot)
- Jonas Flodén (flojon)
- Christian Schmidt
- Jakub Kucharovic (jkucharovic)
- Marcin Sikoń (marphi)
- Dominik Zogg (dominik.zogg)
- Mathieu Lemoine
@ -396,7 +399,6 @@ Symfony is the result of the work of many people who made the code better
- MatTheCat
- John Bafford (jbafford)
- Denis Gorbachev (starfall)
- Titouan Galopin (tgalopin)
- Steven Surowiec
- Kevin Saliou (kbsali)
- Ryan
@ -440,7 +442,6 @@ Symfony is the result of the work of many people who made the code better
- Wang Jingyu
- Åsmund Garfors
- Maxime Douailin
- Gregor Harlan
- Michael Hirschler (mvhirsch)
- Javier López (loalf)
- Reinier Kip
@ -457,7 +458,6 @@ Symfony is the result of the work of many people who made the code better
- Tristan Maindron (tmaindron)
- Ke WANG (yktd26)
- Strate
- Jakub Kucharovic
- Miquel Rodríguez Telep (mrtorrent)
- Sergey Kolodyazhnyy (skolodyazhnyy)
- umpirski
@ -507,6 +507,7 @@ Symfony is the result of the work of many people who made the code better
- Joshua Nye
- Dave Marshall (davedevelopment)
- avorobiev
- Gladhon
- Venu
- Lars Vierbergen
- Dennis Hotson
@ -572,6 +573,7 @@ Symfony is the result of the work of many people who made the code better
- Aleksey Podskrebyshev
- Steffen Roßkamp
- David Marín Carreño (davefx)
- Hidde Boomsma (hboomsma)
- Jörn Lang (j.lang)
- mwsaz
- Benoît Bourgeois
@ -615,6 +617,7 @@ Symfony is the result of the work of many people who made the code better
- Benoît Merlet (trompette)
- Koen Kuipers
- datibbaw
- Sébastien Santoro
- Raul Fraile (raulfraile)
- sensio
- Patrick Kaufmann
@ -686,6 +689,7 @@ Symfony is the result of the work of many people who made the code better
- Max Beutel
- Michal Trojanowski
- Catalin Dan
- Mihai Stancu
- nacho
- Piotr Antosik (antek88)
- Artem Lopata
@ -698,6 +702,7 @@ Symfony is the result of the work of many people who made the code better
- Max Grigorian (maxakawizard)
- benatespina (benatespina)
- Denis Kop
- EdgarPE
- jfcixmedia
- Martijn Evers
- Benjamin Paap (benjaminpaap)
@ -980,6 +985,7 @@ Symfony is the result of the work of many people who made the code better
- Michal Gebauer
- Gleb Sidora
- David Stone
- Adrien Lucas (adrienlucas)
- Pablo Maria Martelletti (pmartelletti)
- Yassine Guedidi (yguedidi)
- Luis Muñoz
@ -1056,6 +1062,7 @@ Symfony is the result of the work of many people who made the code better
- devel
- Trevor Suarez
- gedrox
- Mathieu MARCHOIS
- dropfen
- Andrey Chernykh
- Edvinas Klovas
@ -1179,7 +1186,6 @@ Symfony is the result of the work of many people who made the code better
- srsbiz
- Taylan Kasap
- Nicolas A. Bérard-Nault
- Gladhon
- Saem Ghani
- Stefan Oderbolz
- Curtis
@ -1233,6 +1239,7 @@ Symfony is the result of the work of many people who made the code better
- Eric J. Duran
- cmfcmf
- Drew Butler
- pawel-lewtak
- Steve Müller
- Andras Ratz
- andreabreu98
@ -1260,7 +1267,6 @@ Symfony is the result of the work of many people who made the code better
- Pierre-Louis LAUNAY
- djama
- Eduardo Conceição
- Sébastien Santoro
- Jon Cave
- Sébastien HOUZE
- Abdulkadir N. A.

View File

@ -19,6 +19,7 @@
"php": ">=5.3.9",
"doctrine/common": "~2.4",
"paragonie/random_compat": "~1.0",
"symfony/polyfill-apcu": "~1.0,>=1.0.2",
"twig/twig": "~1.23|~2.0",
"psr/log": "~1.0"
},

View File

@ -67,8 +67,8 @@ class ApcClassLoader
*/
public function __construct($prefix, $decorated)
{
if (!extension_loaded('apc')) {
throw new \RuntimeException('Unable to use ApcClassLoader as APC is not enabled.');
if (!function_exists('apcu_fetch')) {
throw new \RuntimeException('Unable to use ApcClassLoader as APC is not installed.');
}
if (!method_exists($decorated, 'findFile')) {
@ -122,8 +122,8 @@ class ApcClassLoader
*/
public function findFile($class)
{
if (false === $file = apc_fetch($this->prefix.$class)) {
apc_store($this->prefix.$class, $file = $this->decorated->findFile($class));
if (false === $file = apcu_fetch($this->prefix.$class)) {
apcu_store($this->prefix.$class, $file = $this->decorated->findFile($class));
}
return $file;

View File

@ -24,14 +24,14 @@ class ApcClassLoaderTest extends \PHPUnit_Framework_TestCase
if (!(ini_get('apc.enabled') && ini_get('apc.enable_cli'))) {
$this->markTestSkipped('The apc extension is available, but not enabled.');
} else {
apc_clear_cache('user');
apcu_clear_cache();
}
}
protected function tearDown()
{
if (ini_get('apc.enabled') && ini_get('apc.enable_cli')) {
apc_clear_cache('user');
apcu_clear_cache();
}
}
@ -42,7 +42,7 @@ class ApcClassLoaderTest extends \PHPUnit_Framework_TestCase
$loader = new ApcClassLoader('test.prefix.', $loader);
$this->assertEquals($loader->findFile('\Apc\Namespaced\FooBar'), apc_fetch('test.prefix.\Apc\Namespaced\FooBar'), '__construct() takes a prefix as its first argument');
$this->assertEquals($loader->findFile('\Apc\Namespaced\FooBar'), apcu_fetch('test.prefix.\Apc\Namespaced\FooBar'), '__construct() takes a prefix as its first argument');
}
/**

View File

@ -17,7 +17,8 @@
],
"minimum-stability": "dev",
"require": {
"php": ">=5.3.9"
"php": ">=5.3.9",
"symfony/polyfill-apcu": "~1.0,>=1.0.2"
},
"require-dev": {
"symfony/finder": "~2.0,>=2.0.5"

View File

@ -29,13 +29,13 @@ class Cookie
/**
* Constructor.
*
* @param string $name The name of the cookie
* @param string $value The value of the cookie
* @param int|string|\DateTime $expire The time the cookie expires
* @param string $path The path on the server in which the cookie will be available on
* @param string $domain The domain that the cookie is available to
* @param bool $secure Whether the cookie should only be transmitted over a secure HTTPS connection from the client
* @param bool $httpOnly Whether the cookie will be made accessible only through the HTTP protocol
* @param string $name The name of the cookie
* @param string $value The value of the cookie
* @param int|string|\DateTime|\DateTimeInterface $expire The time the cookie expires
* @param string $path The path on the server in which the cookie will be available on
* @param string $domain The domain that the cookie is available to
* @param bool $secure Whether the cookie should only be transmitted over a secure HTTPS connection from the client
* @param bool $httpOnly Whether the cookie will be made accessible only through the HTTP protocol
*
* @throws \InvalidArgumentException
*/
@ -51,7 +51,7 @@ class Cookie
}
// convert expiration time to a Unix timestamp
if ($expire instanceof \DateTime) {
if ($expire instanceof \DateTime || $expire instanceof \DateTimeInterface) {
$expire = $expire->format('U');
} elseif (!is_numeric($expire)) {
$expire = strtotime($expire);

View File

@ -85,6 +85,17 @@ class CookieTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($expire->format('U'), $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date');
}
/**
* @requires PHP 5.5
*/
public function testConstructorWithDateTimeImmutable()
{
$expire = new \DateTimeImmutable();
$cookie = new Cookie('foo', 'bar', $expire);
$this->assertEquals($expire->format('U'), $cookie->getExpiresTime(), '->getExpiresTime() returns the expire date');
}
public function testGetExpiresTimeWithStringValue()
{
$value = '+1 day';