Merge branch '3.0'
* 3.0:
[PhpUnitBridge] Revert 7f62133939
bumped Symfony version to 2.3.40
Fix leftover conflict marker in UPGRADE-3.0.md
set s-maxage only if all responses are cacheable
updated VERSION for 2.3.39
update CONTRIBUTORS for 2.3.39
updated CHANGELOG for 2.3.39
Improved the "branch" row of the PR table
[Debug] Replaced logic for detecting filesystem case sensitivity
[Process] Wait a bit less on Windows
Use debug member variable
Autowiring the concrete class too - consistent with behavior of other services
Fix typos #18090 1. PHPs session design to PHP's session design 2. Symfony HttpKernel offers to Symfony's HttpKernel offers 3. in which case it it should to in which case it should
Fix for Isssue #18091
replace perfom by perform
minor #18088 Fix typo for profiler
[Validator] Fixing inaccurate typehint in docblock
[ci] remove token for composer now that rate limiting is off
This commit is contained in:
commit
04eed4e65b
@ -1,7 +0,0 @@
|
||||
{
|
||||
"github-oauth": {
|
||||
"github.com": "PLEASE DO NOT USE THIS TOKEN IN YOUR OWN PROJECTS/FORKS",
|
||||
"github.com": "This token is reserved for testing the symfony/symfony repository",
|
||||
"github.com": "52270bad1071a099c8d24629f2db2b7f07db960d"
|
||||
}
|
||||
}
|
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,6 +1,6 @@
|
||||
| Q | A
|
||||
| ------------- | ---
|
||||
| Branch | master for features and deprecations / lowest applicable and maintained version otherwise
|
||||
| Branch? | "master" for new features / 2.3, 2.7, 2.8 or 3.0 for fixes
|
||||
| Bug fix? | yes/no
|
||||
| New feature? | yes/no
|
||||
| BC breaks? | yes/no
|
||||
|
@ -16,8 +16,8 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Kris Wallsmith (kriswallsmith)
|
||||
- Jakub Zalas (jakubzalas)
|
||||
- Ryan Weaver (weaverryan)
|
||||
- Hugo Hamon (hhamon)
|
||||
- Javier Eguiluz (javier.eguiluz)
|
||||
- Hugo Hamon (hhamon)
|
||||
- Abdellatif Ait boudad (aitboudad)
|
||||
- Pascal Borreli (pborreli)
|
||||
- Kévin Dunglas (dunglas)
|
||||
@ -35,8 +35,8 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Eriksen Costa (eriksencosta)
|
||||
- Sarah Khalil (saro0h)
|
||||
- Jonathan Wage (jwage)
|
||||
- Maxime Steinhausser (ogizanagi)
|
||||
- Diego Saint Esteben (dosten)
|
||||
- Maxime Steinhausser (ogizanagi)
|
||||
- Alexandre Salomé (alexandresalome)
|
||||
- William Durand (couac)
|
||||
- ornicar
|
||||
@ -56,12 +56,12 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Michel Weimerskirch (mweimerskirch)
|
||||
- Eric Clemmons (ericclemmons)
|
||||
- Andrej Hudec (pulzarraider)
|
||||
- Christian Raue
|
||||
- Matthias Pigulla (mpdude)
|
||||
- Peter Rehm (rpet)
|
||||
- Deni
|
||||
- Henrik Westphal (snc)
|
||||
- Dariusz Górecki (canni)
|
||||
- Christian Raue
|
||||
- Arnout Boks (aboks)
|
||||
- Douglas Greenshields (shieldo)
|
||||
- Lee McDermott
|
||||
@ -79,16 +79,18 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Iltar van der Berg (kjarli)
|
||||
- Arnaud Le Blanc (arnaud-lb)
|
||||
- Jérôme Tamarelle (gromnan)
|
||||
- Jules Pietri (heah)
|
||||
- Michal Piotrowski (eventhorizon)
|
||||
- Tim Nagel (merk)
|
||||
- Paráda József (paradajozsef)
|
||||
- Brice BERNARD (brikou)
|
||||
- Ener-Getick (energetick)
|
||||
- Charles Sarrazin (csarrazi)
|
||||
- Alexander M. Turek (derrabus)
|
||||
- Dariusz Ruminski
|
||||
- marc.weistroff
|
||||
- lenar
|
||||
- Włodzimierz Gajda (gajdaw)
|
||||
- Paráda József (paradajozsef)
|
||||
- Alexander Schwenn (xelaris)
|
||||
- Florian Voutzinos (florianv)
|
||||
- Colin Frei
|
||||
@ -98,13 +100,12 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Peter Kokot (maastermedia)
|
||||
- excelwebzone
|
||||
- Jacob Dreesen (jdreesen)
|
||||
- Konstantin Myakshin (koc)
|
||||
- Jérémy DERUSSÉ (jderusse)
|
||||
- Vladimir Reznichenko (kalessil)
|
||||
- Baptiste Clavié (talus)
|
||||
- Ener-Getick (energetick)
|
||||
- Fabien Pennequin (fabienpennequin)
|
||||
- Gordon Franke (gimler)
|
||||
- Konstantin Myakshin (koc)
|
||||
- Tomáš Votruba (tomas_votruba)
|
||||
- Jáchym Toušek
|
||||
- Robert Schönthal (digitalkaoz)
|
||||
@ -117,7 +118,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Sebastian Hörl (blogsh)
|
||||
- Daniel Gomes (danielcsgomes)
|
||||
- Hidenori Goto (hidenorigoto)
|
||||
- Jules Pietri (heah)
|
||||
- Evgeniy (ewgraf)
|
||||
- Guilherme Blanco (guilhermeblanco)
|
||||
- Pablo Godel (pgodel)
|
||||
@ -146,6 +146,8 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Dmitrii Chekaliuk (lazyhammer)
|
||||
- Clément JOBEILI (dator)
|
||||
- Daniel Wehner
|
||||
- Richard van Laak (rvanlaak)
|
||||
- Possum
|
||||
- Dorian Villet (gnutix)
|
||||
- Javier Spagnoletti (phansys)
|
||||
- Richard Miller (mr_r_miller)
|
||||
@ -154,11 +156,10 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Benjamin Dulau (dbenjamin)
|
||||
- Andreas Hucks (meandmymonkey)
|
||||
- Noel Guilbert (noel)
|
||||
- Richard van Laak (rvanlaak)
|
||||
- Stepan Anchugov (kix)
|
||||
- bronze1man
|
||||
- sun (sun)
|
||||
- Larry Garfield (crell)
|
||||
- Possum
|
||||
- Martin Schuhfuß (usefulthink)
|
||||
- Matthieu Bontemps (mbontemps)
|
||||
- Pierre Minnieur (pminnieur)
|
||||
@ -177,7 +178,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Sven Paulus (subsven)
|
||||
- Lars Strojny (lstrojny)
|
||||
- Rui Marinho (ruimarinho)
|
||||
- Stepan Anchugov (kix)
|
||||
- Eugene Wissner
|
||||
- Julien Brochet (mewt)
|
||||
- Sergey Linnik (linniksa)
|
||||
@ -186,6 +186,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Titouan Galopin (tgalopin)
|
||||
- Loïc Faugeron
|
||||
- Jannik Zschiesche (apfelbox)
|
||||
- Marco Pivetta (ocramius)
|
||||
- julien pauli (jpauli)
|
||||
- Michael Lee (zerustech)
|
||||
- Lorenz Schori
|
||||
@ -265,11 +266,11 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Bob den Otter (bopp)
|
||||
- Adrian Rudnik (kreischweide)
|
||||
- Francesc Rosàs (frosas)
|
||||
- Massimiliano Arione (garak)
|
||||
- Julien Galenski (ruian)
|
||||
- Bongiraud Dominique
|
||||
- janschoenherr
|
||||
- Thomas Schulz (king2500)
|
||||
- Marco Pivetta (ocramius)
|
||||
- Berny Cantos (xphere81)
|
||||
- Ricard Clau (ricardclau)
|
||||
- Mark Challoner (markchalloner)
|
||||
@ -314,6 +315,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Endre Fejes
|
||||
- Tobias Naumann (tna)
|
||||
- Shein Alexey
|
||||
- Baptiste Lafontaine
|
||||
- Joe Lencioni
|
||||
- Daniel Tschinder
|
||||
- Kai
|
||||
@ -336,7 +338,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Oscar Cubo Medina (ocubom)
|
||||
- Karel Souffriau
|
||||
- Christophe L. (christophelau)
|
||||
- Massimiliano Arione (garak)
|
||||
- Anthon Pang (robocoder)
|
||||
- Emanuele Gaspari (inmarelibero)
|
||||
- Dariusz Rumiński
|
||||
@ -388,6 +389,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Roman Lapin (memphys)
|
||||
- Yoshio HANAWA
|
||||
- Gladhon
|
||||
- Benoît Burnichon (bburnichon)
|
||||
- Sebastian Bergmann
|
||||
- Pablo Díez (pablodip)
|
||||
- Kevin McBride
|
||||
@ -397,6 +399,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Ilya Antipenko (aivus)
|
||||
- Iker Ibarguren (ikerib)
|
||||
- Ricardo Oliveira (ricardolotr)
|
||||
- Roy Van Ginneken (rvanginneken)
|
||||
- ondrowan
|
||||
- Barry vd. Heuvel (barryvdh)
|
||||
- Jerzy Zawadzki (jzawadzki)
|
||||
@ -458,7 +461,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Johnny Robeson (johnny)
|
||||
- Disquedur
|
||||
- Michiel Boeckaert (milio)
|
||||
- Baptiste Lafontaine
|
||||
- Geoffrey Tran (geoff)
|
||||
- Jan Behrens
|
||||
- Mantas Var (mvar)
|
||||
@ -514,6 +516,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Luc Vieillescazes (iamluc)
|
||||
- Johann Saunier (prophet777)
|
||||
- Antoine Corcy
|
||||
- Rob Bast
|
||||
- Artur Eshenbrener
|
||||
- Arturs Vonda
|
||||
- Sascha Grossenbacher
|
||||
@ -522,6 +525,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Benjamin Zikarsky (bzikarsky)
|
||||
- Simon Schick (simonsimcity)
|
||||
- redstar504
|
||||
- Tristan Roussel
|
||||
- Hossein Bukhamsin
|
||||
- Disparity
|
||||
- origaminal
|
||||
@ -615,7 +619,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Emanuele Iannone
|
||||
- Tony Malzhacker
|
||||
- Mathieu MARCHOIS
|
||||
- Benoît Burnichon (bburnichon)
|
||||
- Cyril Quintin (cyqui)
|
||||
- Gerard van Helden (drm)
|
||||
- Johnny Peck (johnnypeck)
|
||||
@ -719,17 +722,20 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Danilo Silva
|
||||
- Zachary Tong (polyfractal)
|
||||
- Hryhorii Hrebiniuk
|
||||
- mcfedr (mcfedr)
|
||||
- dantleech
|
||||
- Xavier Leune
|
||||
- Tero Alén (tero)
|
||||
- DerManoMann
|
||||
- Guillaume Royer
|
||||
- Artem (digi)
|
||||
- boite
|
||||
- dantleech
|
||||
- Vadim Tyukov (vatson)
|
||||
- Sortex
|
||||
- chispita
|
||||
- Wojciech Sznapka
|
||||
- Arjan Keeman
|
||||
- Máximo Cuadros (mcuadros)
|
||||
- tamirvs
|
||||
- julien.galenski
|
||||
@ -807,7 +813,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- spdionis
|
||||
- Eduardo García Sanz (coma)
|
||||
- James Gilliland
|
||||
- Roy Van Ginneken
|
||||
- David de Boer (ddeboer)
|
||||
- Gilles Doge (gido)
|
||||
- abulford
|
||||
@ -869,6 +874,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Ludek Stepan
|
||||
- Geoffrey Brier
|
||||
- Aaron Stephens (astephens)
|
||||
- Craig Menning (cmenning)
|
||||
- Balázs Benyó (duplabe)
|
||||
- Erika Heidi Reinaldo (erikaheidi)
|
||||
- Pierre Tachoire (krichprollsch)
|
||||
@ -881,6 +887,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Karol Sójko (karolsojko)
|
||||
- sl_toto (sl_toto)
|
||||
- Walter Dal Mut (wdalmut)
|
||||
- Albin Kerouaton
|
||||
- Sébastien HOUZÉ
|
||||
- Jingyu Wang
|
||||
- Daniel Espendiller
|
||||
@ -900,6 +907,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Daniel Richter (richtermeister)
|
||||
- ChrisC
|
||||
- Ilya Biryukov
|
||||
- Kim Laï Trinh
|
||||
- Jason Desrosiers
|
||||
- m.chwedziak
|
||||
- Philip Frank
|
||||
@ -958,7 +966,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Jānis Lukss
|
||||
- rkerner
|
||||
- Alex Silcock
|
||||
- Rob Bast
|
||||
- Matthew J Mucklo
|
||||
- fdgdfg (psampaz)
|
||||
- Stéphane Seng
|
||||
@ -1024,6 +1031,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Alexandre Segura
|
||||
- Josef Cech
|
||||
- Arnau González (arnaugm)
|
||||
- Simon Bouland (bouland)
|
||||
- Nate (frickenate)
|
||||
- Matthew Foster (mfoster)
|
||||
- Paul Seiffert (seiffert)
|
||||
@ -1087,16 +1095,20 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Jordi Llonch (jordillonch)
|
||||
- Cédric Dugat (ph3nol)
|
||||
- Philip Dahlstrøm (phidah)
|
||||
- Alex Rock Ancelet (pierstoval)
|
||||
- Milos Colakovic (project2481)
|
||||
- Rénald Casagraude (rcasagraude)
|
||||
- Robin Duval (robin-duval)
|
||||
- Grinbergs Reinis (shima5)
|
||||
- Artem Lopata (bumz)
|
||||
- Nicole Cordes
|
||||
- Alexey Popkov
|
||||
- Artyom Protaskin
|
||||
- Nathanael d. Noblet
|
||||
- helmer
|
||||
- ged15
|
||||
- Daan van Renterghem
|
||||
- Nicole Cordes
|
||||
- Bram Van der Sype (brammm)
|
||||
- Julien Moulin (lizjulien)
|
||||
- Nikita Nefedov (nikita2206)
|
||||
@ -1316,7 +1328,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Sema
|
||||
- Elan Ruusamäe
|
||||
- Thorsten Hallwas
|
||||
- Tristan Roussel
|
||||
- Michael Squires
|
||||
- Norman Soetbeer
|
||||
- zorn
|
||||
@ -1399,6 +1410,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Ala Eddine Khefifi (nayzo)
|
||||
- emilienbouard (neime)
|
||||
- Nicholas Byfleet (nickbyfleet)
|
||||
- Tomas Norkūnas (norkunas)
|
||||
- ollie harridge (ollietb)
|
||||
- Paul Andrieux (paulandrieux)
|
||||
- Paweł Szczepanek (pauluz)
|
||||
|
@ -403,7 +403,6 @@ UPGRADE FROM 2.x to 3.0
|
||||
|
||||
* The `choice_list` option of `ChoiceType` was removed.
|
||||
|
||||
>>>>>>> 2.8
|
||||
* The option "precision" was renamed to "scale".
|
||||
|
||||
Before:
|
||||
|
@ -16,7 +16,9 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.5.9"
|
||||
"php": ">=5.3.3 EVEN ON LATEST SYMFONY VERSIONS TO ALLOW USING",
|
||||
"php": "THIS BRIDGE WHEN TESTING LOWEST SYMFONY VERSIONS.",
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader"
|
||||
|
@ -496,7 +496,7 @@ class Configuration implements ConfigurationInterface
|
||||
->children()
|
||||
->scalarNode('cache')->defaultValue('file')->end()
|
||||
->scalarNode('file_cache_dir')->defaultValue('%kernel.cache_dir%/annotations')->end()
|
||||
->booleanNode('debug')->defaultValue('%kernel.debug%')->end()
|
||||
->booleanNode('debug')->defaultValue($this->debug)->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
<service id="service_container" synthetic="true">
|
||||
<autowiring-type>Symfony\Component\DependencyInjection\ContainerInterface</autowiring-type>
|
||||
<autowiring-type>Symfony\Component\DependencyInjection\Container</autowiring-type>
|
||||
</service>
|
||||
|
||||
<service id="kernel" synthetic="true" />
|
||||
|
@ -215,7 +215,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
||||
'annotations' => array(
|
||||
'cache' => 'file',
|
||||
'file_cache_dir' => '%kernel.cache_dir%/annotations',
|
||||
'debug' => '%kernel.debug%',
|
||||
'debug' => true,
|
||||
),
|
||||
'serializer' => array(
|
||||
'enabled' => false,
|
||||
|
@ -42,7 +42,16 @@ class DebugClassLoader
|
||||
$this->isFinder = is_array($classLoader) && method_exists($classLoader[0], 'findFile');
|
||||
|
||||
if (!isset(self::$caseCheck)) {
|
||||
self::$caseCheck = false !== stripos(PHP_OS, 'win') ? (false !== stripos(PHP_OS, 'darwin') ? 2 : 1) : 0;
|
||||
if(!file_exists(strtolower(__FILE__))) {
|
||||
// filesystem is case sensitive
|
||||
self::$caseCheck = 0;
|
||||
} elseif(realpath(strtolower(__FILE__)) === __FILE__) {
|
||||
// filesystem is not case sensitive
|
||||
self::$caseCheck = 1;
|
||||
} else {
|
||||
// filesystem is not case sensitive AND realpath() fails to normalize case
|
||||
self::$caseCheck = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,10 +76,10 @@ interface SessionStorageInterface
|
||||
* Note regenerate+destroy should not clear the session data in memory
|
||||
* only delete the session data from persistent storage.
|
||||
*
|
||||
* Care: When regenerating the session ID no locking is involved in PHPs
|
||||
* Care: When regenerating the session ID no locking is involved in PHP's
|
||||
* session design. See https://bugs.php.net/bug.php?id=61470 for a discussion.
|
||||
* So you must make sure the regenerated session is saved BEFORE sending the
|
||||
* headers with the new ID. Symfonys HttpKernel offers a listener for this.
|
||||
* headers with the new ID. Symfony's HttpKernel offers a listener for this.
|
||||
* See Symfony\Component\HttpKernel\EventListener\SaveSessionListener.
|
||||
* Otherwise session data could get lost again for concurrent requests with the
|
||||
* new ID. One result could be that you get logged out after just logging in.
|
||||
@ -101,7 +101,7 @@ interface SessionStorageInterface
|
||||
*
|
||||
* This method must invoke session_write_close() unless this interface is
|
||||
* used for a storage object design for unit or functional testing where
|
||||
* a real PHP session would interfere with testing, in which case it
|
||||
* a real PHP session would interfere with testing, in which case
|
||||
* it should actually persist the session data if required.
|
||||
*
|
||||
* @throws \RuntimeException If the session is saved without being started, or if the session
|
||||
|
@ -32,6 +32,7 @@ class ResponseCacheStrategy implements ResponseCacheStrategyInterface
|
||||
private $embeddedResponses = 0;
|
||||
private $ttls = array();
|
||||
private $maxAges = array();
|
||||
private $isNotCacheableResponseEmbedded = false;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
@ -41,8 +42,13 @@ class ResponseCacheStrategy implements ResponseCacheStrategyInterface
|
||||
if ($response->isValidateable()) {
|
||||
$this->cacheable = false;
|
||||
} else {
|
||||
$maxAge = $response->getMaxAge();
|
||||
$this->ttls[] = $response->getTtl();
|
||||
$this->maxAges[] = $response->getMaxAge();
|
||||
$this->maxAges[] = $maxAge;
|
||||
|
||||
if (null === $maxAge) {
|
||||
$this->isNotCacheableResponseEmbedded = true;
|
||||
}
|
||||
}
|
||||
|
||||
++$this->embeddedResponses;
|
||||
@ -76,7 +82,9 @@ class ResponseCacheStrategy implements ResponseCacheStrategyInterface
|
||||
$this->ttls[] = $response->getTtl();
|
||||
$this->maxAges[] = $response->getMaxAge();
|
||||
|
||||
if (null !== $maxAge = min($this->maxAges)) {
|
||||
if ($this->isNotCacheableResponseEmbedded) {
|
||||
$response->headers->removeCacheControlDirective('s-maxage');
|
||||
} elseif (null !== $maxAge = min($this->maxAges)) {
|
||||
$response->setSharedMaxAge($maxAge);
|
||||
$response->headers->set('Age', $maxAge - min($this->ttls));
|
||||
}
|
||||
|
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* This code is partially based on the Rack-Cache library by Ryan Tomayko,
|
||||
* which is released under the MIT license.
|
||||
* (based on commit 02d2b48d75bcb63cf1c0c7149c077ad256542801)
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpKernel\Tests\HttpCache;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\HttpCache\EsiResponseCacheStrategy;
|
||||
|
||||
class EsiResponseCacheStrategyTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testMinimumSharedMaxAgeWins()
|
||||
{
|
||||
$cacheStrategy = new EsiResponseCacheStrategy();
|
||||
|
||||
$response1 = new Response();
|
||||
$response1->setSharedMaxAge(60);
|
||||
$cacheStrategy->add($response1);
|
||||
|
||||
$response2 = new Response();
|
||||
$response2->setSharedMaxAge(3600);
|
||||
$cacheStrategy->add($response2);
|
||||
|
||||
$response = new Response();
|
||||
$response->setSharedMaxAge(86400);
|
||||
$cacheStrategy->update($response);
|
||||
|
||||
$this->assertSame('60', $response->headers->getCacheControlDirective('s-maxage'));
|
||||
}
|
||||
|
||||
public function testSharedMaxAgeNotSetIfNotSetInAnyEmbeddedRequest()
|
||||
{
|
||||
$cacheStrategy = new EsiResponseCacheStrategy();
|
||||
|
||||
$response1 = new Response();
|
||||
$response1->setSharedMaxAge(60);
|
||||
$cacheStrategy->add($response1);
|
||||
|
||||
$response2 = new Response();
|
||||
$cacheStrategy->add($response2);
|
||||
|
||||
$response = new Response();
|
||||
$response->setSharedMaxAge(86400);
|
||||
$cacheStrategy->update($response);
|
||||
|
||||
$this->assertFalse($response->headers->hasCacheControlDirective('s-maxage'));
|
||||
}
|
||||
|
||||
public function testSharedMaxAgeNotSetIfNotSetInMasterRequest()
|
||||
{
|
||||
$cacheStrategy = new EsiResponseCacheStrategy();
|
||||
|
||||
$response1 = new Response();
|
||||
$response1->setSharedMaxAge(60);
|
||||
$cacheStrategy->add($response1);
|
||||
|
||||
$response2 = new Response();
|
||||
$response2->setSharedMaxAge(3600);
|
||||
$cacheStrategy->add($response2);
|
||||
|
||||
$response = new Response();
|
||||
$cacheStrategy->update($response);
|
||||
|
||||
$this->assertFalse($response->headers->hasCacheControlDirective('s-maxage'));
|
||||
}
|
||||
}
|
@ -102,7 +102,7 @@ class UnixPipes extends AbstractPipes
|
||||
unset($r[0]);
|
||||
|
||||
// let's have a look if something changed in streams
|
||||
if ($r && false === $n = @stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) {
|
||||
if (($r || $w) && false === $n = @stream_select($r, $w, $e, 0, $blocking ? Process::TIMEOUT_PRECISION * 1E6 : 0)) {
|
||||
// if a system call has been interrupted, forget about it, let's try again
|
||||
// otherwise, an error occurred, let's reset pipes
|
||||
if (!$this->hasSystemCallBeenInterrupted()) {
|
||||
|
@ -106,11 +106,15 @@ class WindowsPipes extends AbstractPipes
|
||||
public function readAndWrite($blocking, $close = false)
|
||||
{
|
||||
$this->unblock();
|
||||
$this->write();
|
||||
$w = $this->write();
|
||||
$read = $r = $e = array();
|
||||
|
||||
$read = array();
|
||||
if ($this->fileHandles && $blocking) {
|
||||
usleep(Process::TIMEOUT_PRECISION * 1E6);
|
||||
if ($blocking) {
|
||||
if ($w) {
|
||||
@stream_select($r, $w, $e, 0, Process::TIMEOUT_PRECISION * 1E6);
|
||||
} elseif ($this->fileHandles) {
|
||||
usleep(Process::TIMEOUT_PRECISION * 1E6);
|
||||
}
|
||||
}
|
||||
foreach ($this->fileHandles as $type => $fileHandle) {
|
||||
$data = stream_get_contents($fileHandle, -1, $this->readBytes[$type]);
|
||||
|
@ -362,8 +362,7 @@ class Process
|
||||
do {
|
||||
$this->checkTimeout();
|
||||
$running = '\\' === DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen();
|
||||
$close = '\\' !== DIRECTORY_SEPARATOR || !$running;
|
||||
$this->readPipes(true, $close);
|
||||
$this->readPipes($running, '\\' !== DIRECTORY_SEPARATOR || !$running);
|
||||
} while ($running);
|
||||
|
||||
while ($this->isRunning()) {
|
||||
@ -1277,14 +1276,15 @@ class Process
|
||||
}
|
||||
|
||||
$this->processInformation = proc_get_status($this->process);
|
||||
$running = $this->processInformation['running'];
|
||||
|
||||
$this->readPipes($blocking, '\\' === DIRECTORY_SEPARATOR ? !$this->processInformation['running'] : true);
|
||||
$this->readPipes($running && $blocking, '\\' !== DIRECTORY_SEPARATOR || !$running);
|
||||
|
||||
if ($this->fallbackStatus && $this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
|
||||
$this->processInformation = $this->fallbackStatus + $this->processInformation;
|
||||
}
|
||||
|
||||
if (!$this->processInformation['running']) {
|
||||
if (!$running) {
|
||||
$this->close();
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ abstract class Constraint
|
||||
/**
|
||||
* Returns the name of the given error code.
|
||||
*
|
||||
* @param int $errorCode The error code
|
||||
* @param string $errorCode The error code
|
||||
*
|
||||
* @return string The name of the error code
|
||||
*
|
||||
|
Reference in New Issue
Block a user