Merge branch '2.6' into 2.7

* 2.6: (21 commits)
  Revert "bug #14262 [TwigBundle] Refresh twig paths when resources change. (aitboudad)"
  InvalidResourceException file name
  [Validators] Remove forgotten space in a translation key [nl]
  [Validators] Correct translation key and content [nl]
  bumped Symfony version to 2.6.9
  updated VERSION for 2.6.8
  updated CHANGELOG for 2.6.8
  added missing CVE number
  bumped Symfony version to 2.3.30
  updated VERSION for 2.3.29
  update CONTRIBUTORS for 2.3.29
  updated CHANGELOG for 2.3.29
  [Validators] Missing translations for arabic language.
  Code style
  fixed C
  [HttpKernel][Bundle] Check extension implements ExtensionInterface
  [DebugBundle] Fix config XSD
  [CS] [Console] StreamOuput : fix loose comparison
  [Framework][router commands] fixed failing test.
  [HttpKernel] Do not call the FragmentListener if _controller is already defined
  ...

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php
This commit is contained in:
Fabien Potencier 2015-05-29 16:44:44 +02:00
commit b07eca5453
20 changed files with 277 additions and 112 deletions

View File

@ -7,6 +7,23 @@ 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.29 (2015-05-26)
* security #14759 CVE-2015-4050 [HttpKernel] Do not call the FragmentListener if _controller is already defined (jakzal)
* bug #14715 [Form] Check instance of FormBuilderInterface instead of FormBuilder (dosten)
* bug #14678 [Security] AbstractRememberMeServices::encodeCookie() validates cookie parts (MacDada)
* bug #14635 [HttpKernel] Handle an array vary header in the http cache store (jakzal)
* bug #14513 [console][formater] allow format toString object. (aitboudad)
* bug #14335 [HttpFoundation] Fix baseUrl when script filename is contained in pathInfo (danez)
* bug #14593 [Security][Firewall] Avoid redirection to XHR URIs (asiragusa)
* bug #14618 [DomCrawler] Throw an exception if a form field path is incomplete (jakzal)
* bug #14698 Fix HTML escaping of to-source links (nicolas-grekas)
* bug #14690 [HttpFoundation] IpUtils::checkIp4() should allow `/0` networks (zerkms)
* bug #14262 [TwigBundle] Refresh twig paths when resources change. (aitboudad)
* bug #13633 [ServerBag] Handled bearer authorization header in REDIRECT_ form (Lance0312)
* bug #13637 [CSS] WebProfiler break words (nicovak)
* bug #14633 [EventDispatcher] make listeners removable from an executed listener (xabbuh)
* 2.3.28 (2015-05-10)
* bug #14266 [HttpKernel] Check if "symfony/proxy-manager-bridge" package is installed (hason)

View File

@ -7,6 +7,33 @@ in 2.6 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.6.0...v2.6.1
* 2.6.8 (2015-05-27)
* security #14759 CVE-2015-4050 [HttpKernel] Do not call the FragmentListener if _controller is already defined (jakzal)
* bug #14743 [DebugBundle] Fix config XSD (nicolas-grekas)
* bug #14726 [Translation] fixed JSON loader on PHP 7 when file is empty (fabpot)
* bug #14715 [Form] Check instance of FormBuilderInterface instead of FormBuilder (dosten)
* bug #14678 [Security] AbstractRememberMeServices::encodeCookie() validates cookie parts (MacDada)
* bug #14635 [HttpKernel] Handle an array vary header in the http cache store (jakzal)
* bug #14513 [console][formater] allow format toString object. (aitboudad)
* bug #14335 [HttpFoundation] Fix baseUrl when script filename is contained in pathInfo (danez)
* bug #14593 [Security][Firewall] Avoid redirection to XHR URIs (asiragusa)
* bug #14618 [DomCrawler] Throw an exception if a form field path is incomplete (jakzal)
* bug #14699 Fix HTML escaping of to-source links (amenk, nicolas-grekas)
* bug #14698 Fix HTML escaping of to-source links (nicolas-grekas)
* bug #14690 [HttpFoundation] IpUtils::checkIp4() should allow `/0` networks (zerkms)
* bug #14696 Fix the rendering of deprecation log messages (stof)
* bug #14683 Fixed the indentation in the compiled template for the DumpNode (stof)
* bug #14262 [TwigBundle] Refresh twig paths when resources change. (aitboudad)
* bug #13633 [ServerBag] Handled bearer authorization header in REDIRECT_ form (Lance0312)
* bug #13637 [CSS] WebProfiler break words (nicovak)
* bug #14217 [WebProfilerBundle] Fix regexp (romqin)
* bug #14644 [Bridge\Twig] Adding a space between the icon and the error message (zmikael, nicolas-grekas)
* bug #14640 [DebugBundle] Allow alternative destination for dumps (nicolas-grekas)
* bug #14633 [EventDispatcher] make listeners removable from an executed listener (xabbuh)
* bug #14609 [DebugBundle] Remove inlined dumps on XHR (nicolas-grekas)
* bug #14605 [PropertyAccess] Fix setting public property on a class having a magic getter (lolautruche)
* 2.6.7 (2015-05-11)
* bug #14266 [HttpKernel] Check if "symfony/proxy-manager-bridge" package is installed (hason)

View File

@ -6,10 +6,10 @@ Symfony is the result of the work of many people who made the code better
- Fabien Potencier (fabpot)
- Bernhard Schussek (bschussek)
- Victor Berchet (victor)
- Tobias Schultze (tobion)
- Jordi Boggiano (seldaek)
- Nicolas Grekas (nicolas-grekas)
- Tobias Schultze (tobion)
- Victor Berchet (victor)
- Jordi Boggiano (seldaek)
- Johannes S (johannes)
- Kris Wallsmith (kriswallsmith)
- Christophe Coevoet (stof)
@ -19,17 +19,17 @@ Symfony is the result of the work of many people who made the code better
- Joseph Bielawski (stloyd)
- Karma Dordrak (drak)
- Ryan Weaver (weaverryan)
- Christian Flothmann (xabbuh)
- Lukas Kahwe Smith (lsmith)
- Romain Neutron (romain)
- Christian Flothmann (xabbuh)
- Jeremy Mikola (jmikola)
- Jean-François Simon (jfsimon)
- Benjamin Eberlei (beberlei)
- Igor Wiedler (igorw)
- Martin Hasoň (hason)
- Eriksen Costa (eriksencosta)
- Grégoire Pineau (lyrixx)
- Abdellatif Ait boudad (aitboudad)
- Grégoire Pineau (lyrixx)
- Wouter De Jong (wouterj)
- Jonathan Wage (jwage)
- Alexandre Salomé (alexandresalome)
@ -37,9 +37,9 @@ Symfony is the result of the work of many people who made the code better
- ornicar
- stealth35 (stealth35)
- Alexander Mols (asm89)
- Kévin Dunglas (dunglas)
- Bulat Shakirzyanov (avalanche123)
- Francis Besset (francisbesset)
- Kévin Dunglas (dunglas)
- Saša Stamenković (umpirsky)
- Henrik Bjørnskov (henrikbjorn)
- Miha Vrhovnik
@ -55,6 +55,7 @@ Symfony is the result of the work of many people who made the code better
- Arnout Boks (aboks)
- Christian Raue
- Michel Weimerskirch (mweimerskirch)
- Diego Saint Esteben (dii3g0)
- Lee McDermott
- Brandon Turner
- Luis Cordova (cordoval)
@ -75,23 +76,23 @@ Symfony is the result of the work of many people who made the code better
- lenar
- Graham Campbell (graham)
- Włodzimierz Gajda (gajdaw)
- Jérôme Tamarelle (gromnan)
- Florian Voutzinos (florianv)
- Colin Frei
- Jérôme Tamarelle (gromnan)
- Adrien Brault (adrienbrault)
- excelwebzone
- Jacob Dreesen (jdreesen)
- Fabien Pennequin (fabienpennequin)
- Matthias Pigulla (mpdude)
- Fabien Pennequin (fabienpennequin)
- Peter Kokot (maastermedia)
- Peter Rehm (rpet)
- Diego Saint Esteben (dii3g0)
- Michal Piotrowski (eventhorizon)
- Stefano Sala (stefano.sala)
- Javier Eguiluz (javier.eguiluz)
- Gordon Franke (gimler)
- Robert Schönthal (digitalkaoz)
- Juti Noppornpitak (shiroyuki)
- Dariusz Ruminski
- Sebastian Hörl (blogsh)
- Daniel Gomes (danielcsgomes)
- Hidenori Goto (hidenorigoto)
@ -102,8 +103,8 @@ Symfony is the result of the work of many people who made the code better
- Eric GELOEN (gelo)
- Jérémie Augustin (jaugustin)
- Rafael Dohms (rdohms)
- Dariusz Ruminski
- Tigran Azatyan (tigranazatyan)
- Alexander Schwenn (xelaris)
- Arnaud Kleinpeter (nanocom)
- Richard Shank (iampersistent)
- Clemens Tolboom
@ -126,7 +127,6 @@ Symfony is the result of the work of many people who made the code better
- Mario A. Alvarez Garcia (nomack84)
- Dennis Benkert (denderello)
- Benjamin Dulau (dbenjamin)
- Alexander Schwenn (xelaris)
- Andreas Hucks (meandmymonkey)
- Noel Guilbert (noel)
- Joel Wurtz (brouznouf)
@ -136,6 +136,7 @@ Symfony is the result of the work of many people who made the code better
- Larry Garfield (crell)
- Martin Schuhfuß (usefulthink)
- Thomas Rabaix (rande)
- Javier Spagnoletti (phansys)
- Matthieu Bontemps (mbontemps)
- Pierre Minnieur (pminnieur)
- fivestar
@ -145,6 +146,7 @@ Symfony is the result of the work of many people who made the code better
- François Zaninotto (fzaninotto)
- Dustin Whittle (dustinwhittle)
- jeff
- Maxime Steinhausser (ogizanagi)
- Joshua Thijssen
- Justin Hileman (bobthecow)
- Sven Paulus (subsven)
@ -156,7 +158,6 @@ Symfony is the result of the work of many people who made the code better
- Tugdual Saunier (tucksaun)
- Sergey Linnik (linniksa)
- Marcel Beerta (mazen)
- Javier Spagnoletti (phansys)
- julien pauli (jpauli)
- Francois Zaninotto
- Alexander Kotynia (olden)
@ -186,10 +187,10 @@ Symfony is the result of the work of many people who made the code better
- Jeremy Livingston (jeremylivingston)
- Nikita Konstantinov
- Wodor Wodorski
- Vincent AUBERT (vincent)
- Matthieu Auger (matthieuauger)
- Beau Simensen (simensen)
- Robert Kiss (kepten)
- Maxime Steinhausser (ogizanagi)
- John Kary (johnkary)
- Ruben Gonzalez (rubenrua)
- Kim Hemsø Rasmussen (kimhemsoe)
@ -234,11 +235,14 @@ Symfony is the result of the work of many people who made the code better
- Vitaliy Zakharov (zakharovvi)
- Tobias Sjösten (tobiassjosten)
- Gyula Sallai (salla)
- Alexander M. Turek (derrabus)
- Konstantin Myakshin (koc)
- Inal DJAFAR (inalgnu)
- Christian Gärtner (dagardner)
- Felix Labrecque
- Yaroslav Kiliba
- Sébastien Lavoie (lavoiesl)
- Stepan Anchugov (kix)
- Terje Bråten
- Kristen Gilden (kgilden)
- Robbert Klarenbeek (robbertkl)
@ -275,6 +279,7 @@ Symfony is the result of the work of many people who made the code better
- Alessandro Desantis
- hubert lecorche (hlecorche)
- Marc Morales Valldepérez (kuert)
- Vadim Kharitonov (virtuozzz)
- Oscar Cubo Medina (ocubom)
- Karel Souffriau
- Christophe L. (christophelau)
@ -295,10 +300,8 @@ Symfony is the result of the work of many people who made the code better
- Antonio J. García Lagar (ajgarlag)
- Olivier Dolbeau (odolbeau)
- Roumen Damianoff (roumen)
- Konstantin Myakshin (koc)
- vagrant
- Asier Illarramendi (doup)
- Alexander M. Turek (derrabus)
- Chris Sedlmayr (catchamonkey)
- Seb Koelen
- Daniel Wehner
@ -306,7 +309,6 @@ Symfony is the result of the work of many people who made the code better
- Vitaliy Tverdokhlib (vitaliytv)
- Ariel Ferrandini (aferrandini)
- Dirk Pahl (dirkaholic)
- Stepan Anchugov (kix)
- cedric lombardot (cedriclombardot)
- Jonas Flodén (flojon)
- Christian Schmidt
@ -318,7 +320,6 @@ Symfony is the result of the work of many people who made the code better
- boombatower
- Fabrice Bernhard (fabriceb)
- Jérôme Macias (jeromemacias)
- Vincent AUBERT (vincent)
- Fabian Lange (codingfabian)
- Yoshio HANAWA
- Tomasz Kowalczyk (thunderer)
@ -336,6 +337,7 @@ Symfony is the result of the work of many people who made the code better
- Jerzy Zawadzki (jzawadzki)
- Evan S Kaufman (evanskaufman)
- mcben
- Jérôme Vieilledent (lolautruche)
- Maks Slesarenko
- mmoreram
- Markus Lanthaler (lanthaler)
@ -371,13 +373,13 @@ Symfony is the result of the work of many people who made the code better
- Massimiliano Arione (garak)
- Ivan Rey (ivanrey)
- Marcin Chyłek (songoq)
- Vadim Kharitonov (virtuozzz)
- Ned Schwartz
- Ziumin
- Lenar Lõhmus
- Zach Badgett (zachbadgett)
- Aurélien Fredouelle
- Pavel Campr (pcampr)
- Johnny Robeson (johnny)
- Disquedur
- Geoffrey Tran (geoff)
- Jan Behrens
@ -405,6 +407,7 @@ Symfony is the result of the work of many people who made the code better
- Wang Jingyu
- Åsmund Garfors
- Maxime Douailin
- Gregor Harlan
- Javier López (loalf)
- Reinier Kip
- Dustin Dobervich (dustin10)
@ -458,6 +461,7 @@ Symfony is the result of the work of many people who made the code better
- Alexander Volochnev (exelenz)
- Michael Piecko
- yclian
- Sebastian Grodzicki (sgrodzicki)
- Pascal Helfenstein
- Baldur Rensch (brensch)
- Alex Xandra Albert Sim
@ -482,11 +486,11 @@ Symfony is the result of the work of many people who made the code better
- Andrew Hilobok (hilobok)
- Christian Soronellas (theunic)
- Yosmany Garcia (yosmanyga)
- Jérôme Vieilledent (lolautruche)
- Degory Valentine
- Benoit Lévêque (benoit_leveque)
- Jeroen Fiege (fieg)
- Krzysiek Łabuś
- Nicolas Dewez (nicolas_dewez)
- Xavier Lacot (xavier)
- Olivier Maisonneuve (olineuve)
- Francis Turmel (fturmel)
@ -494,6 +498,7 @@ Symfony is the result of the work of many people who made the code better
- Ben
- Jayson Xu (superjavason)
- Jaik Dean (jaikdean)
- fago
- Harm van Tilborg
- Jan Prieser
- Damien Alexandre (damienalexandre)
@ -502,6 +507,7 @@ Symfony is the result of the work of many people who made the code better
- Christopher Hall (mythmakr)
- Paul Kamer (pkamer)
- Rafał Wrzeszcz (rafalwrzeszcz)
- Berny Cantos (xphere81)
- Reen Lokum
- Martin Parsiegla (spea)
- Quentin Schuler
@ -531,6 +537,7 @@ Symfony is the result of the work of many people who made the code better
- corphi
- grizlik
- Derek ROTH
- Alain Hippolyte (aloneh)
- Shin Ohno (ganchiku)
- Geert De Deckere (geertdd)
- Jan Kramer (jankramer)
@ -559,7 +566,6 @@ Symfony is the result of the work of many people who made the code better
- Maks
- Gábor Tóth
- Daniel Cestari
- Johnny Robeson (johnny)
- Brunet Laurent (lbrunet)
- Magnus Nordlander (magnusnordlander)
- Mikhail Yurasov (mym)
@ -572,6 +578,7 @@ Symfony is the result of the work of many people who made the code better
- Raul Fraile (raulfraile)
- sensio
- Patrick Kaufmann
- stefan.r
- Matthieu Napoli (mnapoli)
- Ben Ramsey (ramsey)
- Christian Jul Jensen
@ -613,6 +620,7 @@ Symfony is the result of the work of many people who made the code better
- chispita
- Wojciech Sznapka
- Máximo Cuadros (mcuadros)
- Stefan Gehrig (sgehrig)
- Alex Bogomazov
- tamirvs
- julien.galenski
@ -684,7 +692,6 @@ Symfony is the result of the work of many people who made the code better
- Gustavo Adrian
- Yannick
- Eduardo García Sanz (coma)
- Sebastian Grodzicki (sgrodzicki)
- James Gilliland
- Michael Lee (zerustech)
- Roy Van Ginneken
@ -725,7 +732,6 @@ Symfony is the result of the work of many people who made the code better
- Jeroen van den Enden (stoefke)
- origaminal
- Quique Porta (quiqueporta)
- Gregor Harlan
- Tomasz Szymczyk (karion)
- ConneXNL
- Aharon Perkel
@ -983,11 +989,13 @@ Symfony is the result of the work of many people who made the code better
- Mark de Haan (markdehaan)
- Dan Patrick (mdpatrick)
- Rares Vlaseanu (raresvla)
- Artur Melo (restless)
- Sofiane HADDAG (sofhad)
- tante kinast (tante)
- Vincent LEFORT (vlefort)
- Sadicov Vladimir (xtech)
- Alexander Zogheb
- Rémi Blaise
- Joel Marcey
- David Christmann
- root
@ -1013,7 +1021,6 @@ Symfony is the result of the work of many people who made the code better
- Hein Zaw Htet™
- Ruben Kruiswijk
- Michael J
- Berny Cantos
- Joseph Maarek
- Alex Pods
- timaschew
@ -1024,6 +1031,7 @@ Symfony is the result of the work of many people who made the code better
- Filipe Guerra
- Gerben Wijnja
- Rowan Manning
- Per Modin
- David Windell
- Gabriel Birke
- Steffen Roßkamp
@ -1176,6 +1184,7 @@ Symfony is the result of the work of many people who made the code better
- TeLiXj
- Oncle Tom
- Christian Stocker
- Dawid Nowak
- Karolis Daužickas
- tirnanog06
- phc
@ -1189,10 +1198,10 @@ Symfony is the result of the work of many people who made the code better
- Andreas Forsblom (aforsblo)
- Alaattin Kahramanlar (alaattin)
- Alex Olmos (alexolmos)
- Alain Hippolyte (aloneh)
- Antonio Mansilla (amansilla)
- Juan Ases García (ases)
- Daniel Basten (axhm3a)
- DUPUCH (bdupuch)
- Bill Hance (billhance)
- Bernd Matzner (bmatzner)
- Choong Wei Tjeng (choonge)
@ -1231,6 +1240,7 @@ Symfony is the result of the work of many people who made the code better
- Ala Eddine Khefifi (nayzo)
- emilienbouard (neime)
- ollie harridge (ollietb)
- Paul Andrieux (paulandrieux)
- Paweł Szczepanek (pauluz)
- Christian López Espínola (penyaskito)
- Petr Jaroš (petajaros)
@ -1250,6 +1260,7 @@ Symfony is the result of the work of many people who made the code better
- Julien Sanchez (sumbobyboys)
- Guillermo Gisinger (t3chn0r)
- Markus Tacker (tacker)
- Tomáš Votruba (tomas_votruba)
- Tyler Stroud (tystr)
- Moritz Kraft (userfriendly)
- Víctor Mateo (victormateo)

View File

@ -9,5 +9,6 @@
<xsd:complexType name="config">
<xsd:attribute name="max-items" type="xsd:integer" />
<xsd:attribute name="max-string-length" type="xsd:integer" />
<xsd:attribute name="dump-destination" type="xsd:string" />
</xsd:complexType>
</xsd:schema>

View File

@ -56,7 +56,7 @@ class RouterDebugCommandTest extends \PHPUnit_Framework_TestCase
$command->setContainer($this->getContainer());
$application->add($command);
return new CommandTester($application->find('router:debug'));
return new CommandTester($application->find('debug:router'));
}
private function getContainer()
@ -65,11 +65,15 @@ class RouterDebugCommandTest extends \PHPUnit_Framework_TestCase
$routeCollection->add('foo', new Route('foo'));
$router = $this->getMock('Symfony\Component\Routing\RouterInterface');
$router
->expects($this->atLeastOnce())
->expects($this->any())
->method('getRouteCollection')
->will($this->returnValue($routeCollection))
;
$loader = $this->getMockBuilder('Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader')
->disableOriginalConstructor()
->getMock();
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$container
->expects($this->once())
@ -77,12 +81,13 @@ class RouterDebugCommandTest extends \PHPUnit_Framework_TestCase
->with('router')
->will($this->returnValue(true))
;
$container
->expects($this->atLeastOnce())
->method('get')
->with('router')
->will($this->returnValue($router))
;
->will($this->returnValueMap(array(
array('router', 1, $router),
array('controller_name_converter', 1, $loader),
)));
return $container;
}

View File

@ -74,19 +74,22 @@ class RouterMatchCommandTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue($requestContext))
;
$loader = $this->getMockBuilder('Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader')
->disableOriginalConstructor()
->getMock();
$container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$container
->expects($this->once())
->method('has')
->with('router')
->will($this->returnValue(true))
;
$container
->expects($this->atLeastOnce())
->method('get')
->with('router')
->will($this->returnValue($router))
;
->will($this->returnValue(true));
$container->method('get')
->will($this->returnValueMap(array(
array('router', 1, $router),
array('controller_name_converter', 1, $loader),
)));
return $container;
}

View File

@ -12,7 +12,6 @@
namespace Symfony\Bundle\TwigBundle\DependencyInjection;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Resource\DirectoryResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
@ -75,26 +74,22 @@ class TwigExtension extends Extension
} else {
$twigFilesystemLoaderDefinition->addMethodCall('addPath', array($path, $namespace));
}
$container->addResource(new DirectoryResource($path));
}
// register bundles as Twig namespaces
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
if (is_dir($dir = $container->getParameter('kernel.root_dir').'/Resources/'.$bundle.'/views')) {
$this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle);
$container->addResource(new DirectoryResource($dir));
}
$reflection = new \ReflectionClass($class);
if (is_dir($dir = dirname($reflection->getFilename()).'/Resources/views')) {
$this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle);
$container->addResource(new DirectoryResource($dir));
}
}
if (is_dir($dir = $container->getParameter('kernel.root_dir').'/Resources/views')) {
$twigFilesystemLoaderDefinition->addMethodCall('addPath', array($dir));
$container->addResource(new DirectoryResource($dir));
}
if (!empty($config['globals'])) {

View File

@ -94,7 +94,7 @@ class StreamOutput extends Output
*/
protected function hasColorSupport()
{
if (DIRECTORY_SEPARATOR == '\\') {
if (DIRECTORY_SEPARATOR === '\\') {
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
}

View File

@ -76,6 +76,8 @@ class Container implements IntrospectableContainerInterface
protected $scopeStacks = array();
protected $loading = array();
private $underscoreMap = array('_' => '', '.' => '_', '\\' => '_');
/**
* Constructor.
*
@ -211,7 +213,7 @@ class Container implements IntrospectableContainerInterface
$this->services[$id] = $service;
if (method_exists($this, $method = 'synchronize'.strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')) {
if (method_exists($this, $method = 'synchronize'.strtr($id, $this->underscoreMap).'Service')) {
$this->$method();
}
@ -235,17 +237,20 @@ class Container implements IntrospectableContainerInterface
*/
public function has($id)
{
$id = strtolower($id);
if ('service_container' === $id) {
return true;
for ($i = 2;;) {
if ('service_container' === $id
|| isset($this->aliases[$id])
|| isset($this->services[$id])
|| array_key_exists($id, $this->services)
) {
return true;
}
if (--$i && $id !== $lcId = strtolower($id)) {
$id = $lcId;
} else {
return method_exists($this, 'get'.strtr($id, $this->underscoreMap).'Service');
}
}
return isset($this->services[$id])
|| array_key_exists($id, $this->services)
|| isset($this->aliases[$id])
|| method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')
;
}
/**
@ -273,10 +278,7 @@ class Container implements IntrospectableContainerInterface
// available services. Service IDs are case insensitive, however since
// this method can be called thousands of times during a request, avoid
// calling strtolower() unless necessary.
foreach (array(false, true) as $strtolower) {
if ($strtolower) {
$id = strtolower($id);
}
for ($i = 2;;) {
if ('service_container' === $id) {
return $this;
}
@ -287,57 +289,60 @@ class Container implements IntrospectableContainerInterface
if (isset($this->services[$id]) || array_key_exists($id, $this->services)) {
return $this->services[$id];
}
}
if (isset($this->loading[$id])) {
throw new ServiceCircularReferenceException($id, array_keys($this->loading));
}
if (isset($this->loading[$id])) {
throw new ServiceCircularReferenceException($id, array_keys($this->loading));
}
if (isset($this->methodMap[$id])) {
$method = $this->methodMap[$id];
} elseif (method_exists($this, $method = 'get'.strtr($id, array('_' => '', '.' => '_', '\\' => '_')).'Service')) {
// $method is set to the right value, proceed
} else {
if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
if (!$id) {
throw new ServiceNotFoundException($id);
}
$alternatives = array();
foreach ($this->services as $key => $associatedService) {
$lev = levenshtein($id, $key);
if ($lev <= strlen($id) / 3 || false !== strpos($key, $id)) {
$alternatives[] = $key;
if (isset($this->methodMap[$id])) {
$method = $this->methodMap[$id];
} elseif (--$i && $id !== $lcId = strtolower($id)) {
$id = $lcId;
continue;
} elseif (method_exists($this, $method = 'get'.strtr($id, $this->underscoreMap).'Service')) {
// $method is set to the right value, proceed
} else {
if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
if (!$id) {
throw new ServiceNotFoundException($id);
}
$alternatives = array();
foreach ($this->services as $key => $associatedService) {
$lev = levenshtein($id, $key);
if ($lev <= strlen($id) / 3 || false !== strpos($key, $id)) {
$alternatives[] = $key;
}
}
throw new ServiceNotFoundException($id, null, null, $alternatives);
}
throw new ServiceNotFoundException($id, null, null, $alternatives);
}
return;
}
$this->loading[$id] = true;
try {
$service = $this->$method();
} catch (\Exception $e) {
unset($this->loading[$id]);
if (array_key_exists($id, $this->services)) {
unset($this->services[$id]);
}
if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) {
return;
}
throw $e;
$this->loading[$id] = true;
try {
$service = $this->$method();
} catch (\Exception $e) {
unset($this->loading[$id]);
if (array_key_exists($id, $this->services)) {
unset($this->services[$id]);
}
if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) {
return;
}
throw $e;
}
unset($this->loading[$id]);
return $service;
}
unset($this->loading[$id]);
return $service;
}
/**

View File

@ -322,7 +322,7 @@ class ContainerTest extends \PHPUnit_Framework_TestCase
$container->enterScope('foo');
$scoped2 = $container->get('scoped');
$scoped3 = $container->get('scoped');
$scoped3 = $container->get('SCOPED');
$scopedFoo2 = $container->get('scoped_foo');
$container->leaveScope('foo');

View File

@ -76,6 +76,10 @@ abstract class Bundle extends ContainerAware implements BundleInterface
if (class_exists($class)) {
$extension = new $class();
if (!$extension instanceof ExtensionInterface) {
throw new \LogicException(sprintf('Extension %s must implement Symfony\Component\DependencyInjection\Extension\ExtensionInterface.', $class));
}
// check naming convention
$basename = preg_replace('/Bundle$/', '', $this->getName());
$expectedAlias = Container::underscore($basename);

View File

@ -57,7 +57,7 @@ class FragmentListener implements EventSubscriberInterface
{
$request = $event->getRequest();
if ($this->fragmentPath !== rawurldecode($request->getPathInfo())) {
if ($request->attributes->has('_controller') || $this->fragmentPath !== rawurldecode($request->getPathInfo())) {
return;
}

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\HttpKernel\Tests\Bundle;
use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionNotValidBundle\ExtensionNotValidBundle;
use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\ExtensionPresentBundle;
use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionAbsentBundle\ExtensionAbsentBundle;
use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\Command\FooCommand;
@ -30,4 +31,14 @@ class BundleTest extends \PHPUnit_Framework_TestCase
$this->assertNull($bundle2->registerCommands($app));
}
/**
* @expectedException \LogicException
* @expectedExceptionMessage must implement Symfony\Component\DependencyInjection\Extension\ExtensionInterface
*/
public function testGetContainerExtensionWithInvalidClass()
{
$bundle = new ExtensionNotValidBundle();
$bundle->getContainerExtension();
}
}

View File

@ -34,6 +34,22 @@ class FragmentListenerTest extends \PHPUnit_Framework_TestCase
$this->assertTrue($request->query->has('_path'));
}
public function testOnlyTriggeredIfControllerWasNotDefinedYet()
{
$request = Request::create('http://example.com/_fragment?_path=foo%3Dbar%26_controller%3Dfoo');
$request->attributes->set('_controller', 'bar');
$listener = new FragmentListener(new UriSigner('foo'));
$event = $this->createGetResponseEvent($request, HttpKernelInterface::SUB_REQUEST);
$expected = $request->attributes->all();
$listener->onKernelRequest($event);
$this->assertEquals($expected, $request->attributes->all());
}
/**
* @expectedException \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
*/
@ -74,8 +90,8 @@ class FragmentListenerTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($request->query->has('_path'));
}
private function createGetResponseEvent(Request $request)
private function createGetResponseEvent(Request $request, $requestType = HttpKernelInterface::MASTER_REQUEST)
{
return new GetResponseEvent($this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'), $request, HttpKernelInterface::MASTER_REQUEST);
return new GetResponseEvent($this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'), $request, $requestType);
}
}

View File

@ -0,0 +1,20 @@
<?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\HttpKernel\Tests\Fixtures\ExtensionNotValidBundle\DependencyInjection;
class ExtensionNotValidExtension
{
public function getAlias()
{
return 'extension_not_valid';
}
}

View File

@ -0,0 +1,18 @@
<?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\HttpKernel\Tests\Fixtures\ExtensionNotValidBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ExtensionNotValidBundle extends Bundle
{
}

View File

@ -59,7 +59,7 @@ class PropertyNormalizer extends AbstractNormalizer
}
// Override visibility
if (! $property->isPublic()) {
if (!$property->isPublic()) {
$property->setAccessible(true);
}
@ -111,7 +111,7 @@ class PropertyNormalizer extends AbstractNormalizer
$property = $reflectionClass->getProperty($propertyName);
// Override visibility
if (! $property->isPublic()) {
if (!$property->isPublic()) {
$property->setAccessible(true);
}
@ -151,7 +151,7 @@ class PropertyNormalizer extends AbstractNormalizer
// We look for at least one non-static property
foreach ($class->getProperties() as $property) {
if (! $property->isStatic()) {
if (!$property->isStatic()) {
return true;
}
}

View File

@ -148,7 +148,7 @@ class XliffFileLoader implements LoaderInterface
$source = str_replace('http://www.w3.org/2001/xml.xsd', $location, $source);
if (!@$dom->schemaValidateSource($source)) {
throw new InvalidResourceException(implode("\n", $this->getXmlErrors($internalErrors)));
throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s', $file, implode("\n", $this->getXmlErrors($internalErrors))));
}
$dom->normalizeDocument();

View File

@ -278,6 +278,38 @@
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<target>القيمة يجب ان لا تطابق {{ compared_value_type }} {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="73">
<source>The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.</source>
<target>نسبة العرض على الارتفاع للصورة كبيرة جدا ({{ ratio }}). الحد الأقصى للنسبة المسموح به هو {{ max_ratio }}.</target>
</trans-unit>
<trans-unit id="74">
<source>The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.</source>
<target>نسبة العرض على الارتفاع للصورة صغيرة جدا ({{ ratio }}). الحد الأدنى للنسبة المسموح به هو {{ max_ratio }}.</target>
</trans-unit>
<trans-unit id="75">
<source>The image is square ({{ width }}x{{ height }}px). Square images are not allowed.</source>
<target>الصورة مربعة ({{ width }}x{{ height }}px). الصور المربعة غير مسموح بها.</target>
</trans-unit>
<trans-unit id="76">
<source>The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.</source>
<target>الصورة في وضع أفقي ({{ width }}x{{ height }}px). الصور في وضع أفقي غير مسموح بها.</target>
</trans-unit>
<trans-unit id="77">
<source>The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.</source>
<target>الصورة في وضع عمودي ({{ width }}x{{ height }}px). الصور في وضع عمودي غير مسموح بها.</target>
</trans-unit>
<trans-unit id="78">
<source>An empty file is not allowed.</source>
<target>ملف فارغ غير مسموح به.</target>
</trans-unit>
<trans-unit id="79">
<source>The host could not be resolved.</source>
<target>يتعذر الإتصال بالنطاق.</target>
</trans-unit>
<trans-unit id="80">
<source>This value does not match the expected {{ charset }} charset.</source>
<target>هذه القيمة غير متطابقة مع صيغة التحويل {{ charset }}.</target>
</trans-unit>
</body>
</file>
</xliff>

View File

@ -259,7 +259,7 @@
<target>Deze waarde moet groter dan of gelijk aan {{ compared_value }} zijn.</target>
</trans-unit>
<trans-unit id="68">
<source>This value should be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<source>This value should be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<target>Deze waarde moet identiek zijn aan {{ compared_value_type }} {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="69">
@ -275,8 +275,8 @@
<target>Deze waarde mag niet gelijk zijn aan {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="72">
<source>This value should not be identical to {{ compared_value }}.</source>
<target>Deze waarde mag niet identiek zijn aan {{ compared_value }}.</target>
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
<target>Deze waarde mag niet identiek zijn aan {{ compared_value_type }} {{ compared_value }}.</target>
</trans-unit>
<trans-unit id="73">
<source>The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.</source>