Merge branch '2.7' into 2.8
* 2.7: Compatibility with Twig 1.27 Enhance GAE compat by removing some realpath() bumped Symfony version to 2.7.21 updated VERSION for 2.7.20 update CONTRIBUTORS for 2.7.20 updated CHANGELOG for 2.7.20 [SecurityBundle] Fix twig-bridge lowest dep
This commit is contained in:
commit
d12f26992b
@ -7,6 +7,28 @@ in 2.7 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.7.0...v2.7.1
|
||||
|
||||
* 2.7.20 (2016-10-27)
|
||||
|
||||
* bug #20289 Fix edge case with StreamedResponse where headers are sent twice (Nicofuma)
|
||||
* bug #20278 [DependencyInjection] merge tags instead of completely replacing them (xabbuh)
|
||||
* bug #20271 Changes related to Twig 1.27 (fabpot)
|
||||
* bug #20252 Trim constant values in XmlFileLoader (lstrojny)
|
||||
* bug #20253 [TwigBridge] Use non-deprecated Twig_Node::getTemplateLine() (fabpot)
|
||||
* bug #20235 [DomCrawler] Allow pipe (|) character in link tags when using Xpath expressions (klausi, nicolas-grekas)
|
||||
* bug #20224 [Twig] removed deprecations added in Twig 1.27 (fabpot)
|
||||
* bug #19478 fixed Filesystem:makePathRelative and added 2 more testcases (muhammedeminakbulut)
|
||||
* bug #20218 [HttpFoundation] no 304 response if method is not cacheable (xabbuh)
|
||||
* bug #20207 [DependencyInjection] move tags from decorated to decorating service (xabbuh)
|
||||
* bug #20205 [HttpCache] fix: do not cache OPTIONS request (dmaicher)
|
||||
* bug #20146 [Validator] Prevent infinite loop in PropertyMetadata (wesleylancel)
|
||||
* bug #20184 [FrameworkBundle] Convert null prefix to an empty string in translation:update (chalasr)
|
||||
* bug #19725 [Security] $attributes can be anything, but RoleVoter assumes strings (Jonatan Männchen)
|
||||
* bug #20127 [HttpFoundation] JSONP callback validation (ro0NL)
|
||||
* bug #20163 add missing use statement (xabbuh)
|
||||
* bug #19961 [Console] Escape question text and default value in SymfonyStyle::ask() (chalasr)
|
||||
* bug #20141 [Console] Fix validation of empty values using SymfonyQuestionHelper::ask() (chalasr)
|
||||
* bug #20147 [FrameworkBundle] Alter container class instead of kernel name in cache:clear command (nicolas-grekas)
|
||||
|
||||
* 2.7.19 (2016-10-03)
|
||||
|
||||
* bug #20102 [Validator] Url validator not validating hosts ending in a number (gwkunze)
|
||||
|
@ -33,8 +33,8 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Igor Wiedler (igorw)
|
||||
- Grégoire Pineau (lyrixx)
|
||||
- Eriksen Costa (eriksencosta)
|
||||
- Sarah Khalil (saro0h)
|
||||
- Jules Pietri (heah)
|
||||
- Sarah Khalil (saro0h)
|
||||
- Maxime Steinhausser (ogizanagi)
|
||||
- Jonathan Wage (jwage)
|
||||
- Diego Saint Esteben (dosten)
|
||||
@ -49,13 +49,13 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Henrik Bjørnskov (henrikbjorn)
|
||||
- Miha Vrhovnik
|
||||
- Diego Saint Esteben (dii3g0)
|
||||
- Robin Chalas (chalas_r)
|
||||
- Ener-Getick (energetick)
|
||||
- Konstantin Kudryashov (everzet)
|
||||
- Bilal Amarni (bamarni)
|
||||
- Florin Patan (florinpatan)
|
||||
- Peter Rehm (rpet)
|
||||
- Iltar van der Berg (kjarli)
|
||||
- Robin Chalas (chalas_r)
|
||||
- Kevin Bond (kbond)
|
||||
- Andrej Hudec (pulzarraider)
|
||||
- Gábor Egyed (1ed)
|
||||
@ -69,6 +69,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Henrik Westphal (snc)
|
||||
- Dariusz Górecki (canni)
|
||||
- Douglas Greenshields (shieldo)
|
||||
- Konstantin Myakshin (koc)
|
||||
- Lee McDermott
|
||||
- Brandon Turner
|
||||
- Luis Cordova (cordoval)
|
||||
@ -76,7 +77,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Titouan Galopin (tgalopin)
|
||||
- Daniel Holmes (dholmes)
|
||||
- Pierre du Plessis (pierredup)
|
||||
- Konstantin Myakshin (koc)
|
||||
- Bart van den Burg (burgov)
|
||||
- Jordan Alliot (jalliot)
|
||||
- John Wards (johnwards)
|
||||
@ -84,17 +84,19 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Fran Moreno (franmomu)
|
||||
- Antoine Hérault (herzult)
|
||||
- Paráda József (paradajozsef)
|
||||
- Jáchym Toušek (enumag)
|
||||
- Arnaud Le Blanc (arnaud-lb)
|
||||
- Jérôme Tamarelle (gromnan)
|
||||
- Michal Piotrowski (eventhorizon)
|
||||
- Tim Nagel (merk)
|
||||
- Dariusz Ruminski
|
||||
- Brice BERNARD (brikou)
|
||||
- Alexander M. Turek (derrabus)
|
||||
- Dariusz Ruminski
|
||||
- marc.weistroff
|
||||
- Issei Murasawa (issei_m)
|
||||
- lenar
|
||||
- Włodzimierz Gajda (gajdaw)
|
||||
- Roland Franssen (ro0)
|
||||
- Baptiste Clavié (talus)
|
||||
- Alexander Schwenn (xelaris)
|
||||
- Florian Voutzinos (florianv)
|
||||
@ -104,8 +106,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Peter Kokot (maastermedia)
|
||||
- excelwebzone
|
||||
- Jacob Dreesen (jdreesen)
|
||||
- Jáchym Toušek (enumag)
|
||||
- Roland Franssen (ro0)
|
||||
- Jérémy DERUSSÉ (jderusse)
|
||||
- Vladimir Reznichenko (kalessil)
|
||||
- Tomáš Votruba (tomas_votruba)
|
||||
@ -131,6 +131,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Andréia Bohner (andreia)
|
||||
- Rafael Dohms (rdohms)
|
||||
- Arnaud Kleinpeter (nanocom)
|
||||
- jwdeitch
|
||||
- Joel Wurtz (brouznouf)
|
||||
- Philipp Wahala (hifi)
|
||||
- Vyacheslav Pavlov
|
||||
@ -139,6 +140,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Thomas Rabaix (rande)
|
||||
- Vincent AUBERT (vincent)
|
||||
- Rouven Weßling (realityking)
|
||||
- Teoh Han Hui (teohhanhui)
|
||||
- Mikael Pajunen
|
||||
- Clemens Tolboom
|
||||
- Helmer Aaviksoo
|
||||
@ -149,7 +151,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Amal Raghav (kertz)
|
||||
- Jonathan Ingram (jonathaningram)
|
||||
- Artur Kotyrba
|
||||
- Teoh Han Hui (teohhanhui)
|
||||
- Warnar Boekkooi (boekkooi)
|
||||
- Dmitrii Chekaliuk (lazyhammer)
|
||||
- Clément JOBEILI (dator)
|
||||
@ -159,10 +160,12 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Richard Miller (mr_r_miller)
|
||||
- Mario A. Alvarez Garcia (nomack84)
|
||||
- Dennis Benkert (denderello)
|
||||
- jeremyFreeAgent (Jérémy Romey) (jeremyfreeagent)
|
||||
- Benjamin Dulau (dbenjamin)
|
||||
- Mathieu Lemoine (lemoinem)
|
||||
- Andreas Hucks (meandmymonkey)
|
||||
- Noel Guilbert (noel)
|
||||
- Lars Strojny (lstrojny)
|
||||
- Yonel Ceruto González (yonelceruto)
|
||||
- Stepan Anchugov (kix)
|
||||
- bronze1man
|
||||
@ -185,13 +188,11 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Michele Orselli (orso)
|
||||
- Tom Van Looy (tvlooy)
|
||||
- Sven Paulus (subsven)
|
||||
- Lars Strojny (lstrojny)
|
||||
- Rui Marinho (ruimarinho)
|
||||
- Daniel Espendiller
|
||||
- Dawid Nowak
|
||||
- Eugene Wissner
|
||||
- Julien Brochet (mewt)
|
||||
- jeremyFreeAgent (jeremyfreeagent)
|
||||
- Sergey Linnik (linniksa)
|
||||
- Michaël Perrin (michael.perrin)
|
||||
- Marcel Beerta (mazen)
|
||||
@ -226,6 +227,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Jakub Kucharovic (jkucharovic)
|
||||
- Eugene Leonovich (rybakit)
|
||||
- Filippo Tessarotto
|
||||
- Tristan Darricau (nicofuma)
|
||||
- Joseph Rouff (rouffj)
|
||||
- Félix Labrecque (woodspire)
|
||||
- GordonsLondon
|
||||
@ -262,7 +264,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Oleg Voronkovich
|
||||
- Manuel Kiessling (manuelkiessling)
|
||||
- Daniel Wehner
|
||||
- Tristan Darricau (nicofuma)
|
||||
- Atsuhiro KUBO (iteman)
|
||||
- Andrew Moore (finewolf)
|
||||
- Bertrand Zuchuat (garfield-fr)
|
||||
@ -387,6 +388,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Ariel Ferrandini (aferrandini)
|
||||
- Dirk Pahl (dirkaholic)
|
||||
- cedric lombardot (cedriclombardot)
|
||||
- David Maicher (dmaicher)
|
||||
- Jonas Flodén (flojon)
|
||||
- Christian Schmidt
|
||||
- Marcin Sikoń (marphi)
|
||||
@ -535,6 +537,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Daisuke Ohata
|
||||
- Vincent Simonin
|
||||
- Alex Bogomazov (alebo)
|
||||
- maxime.steinhausser
|
||||
- Stefan Warman
|
||||
- Tristan Maindron (tmaindron)
|
||||
- Ke WANG (yktd26)
|
||||
@ -546,11 +549,11 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Ulumuddin Yunus (joenoez)
|
||||
- Luc Vieillescazes (iamluc)
|
||||
- Johann Saunier (prophet777)
|
||||
- Michael Devery (mickadoo)
|
||||
- Antoine Corcy
|
||||
- Artur Eshenbrener
|
||||
- Arturs Vonda
|
||||
- Sascha Grossenbacher
|
||||
- David Maicher (dmaicher)
|
||||
- Szijarto Tamas
|
||||
- Catalin Dan
|
||||
- Stephan Vock
|
||||
@ -593,6 +596,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Vladyslav Petrovych
|
||||
- Alex Xandra Albert Sim
|
||||
- Carson Full
|
||||
- Andrey Astakhov (aast)
|
||||
- Trent Steel (trsteel88)
|
||||
- Yuen-Chi Lian
|
||||
- Besnik Br
|
||||
@ -602,12 +606,14 @@ Symfony is the result of the work of many people who made the code better
|
||||
- avorobiev
|
||||
- Venu
|
||||
- Lars Vierbergen
|
||||
- Jonatan Männchen
|
||||
- Dennis Hotson
|
||||
- Andrew Tchircoff (andrewtch)
|
||||
- michaelwilliams
|
||||
- 1emming
|
||||
- Victor Bocharsky (bocharsky_bw)
|
||||
- Leevi Graham (leevigraham)
|
||||
- Jordan Deitch
|
||||
- Casper Valdemar Poulsen
|
||||
- Josiah (josiah)
|
||||
- Joschi Kuphal
|
||||
@ -740,6 +746,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Alexandru Furculita (afurculita)
|
||||
- Ben Ramsey (ramsey)
|
||||
- Christian Jul Jensen
|
||||
- Alexandre GESLIN (alexandregeslin)
|
||||
- The Whole Life to Learn
|
||||
- Farhad Safarov
|
||||
- Liverbool (liverbool)
|
||||
@ -870,12 +877,14 @@ Symfony is the result of the work of many people who made the code better
|
||||
- James Gilliland
|
||||
- Rhodri Pugh (rodnaph)
|
||||
- David de Boer (ddeboer)
|
||||
- Klaus Purer
|
||||
- Gilles Doge (gido)
|
||||
- abulford
|
||||
- antograssiot
|
||||
- Brooks Boyd
|
||||
- Roger Webb
|
||||
- Dmitriy Simushev
|
||||
- Ivo Bathke (ivoba)
|
||||
- Max Voloshin (maxvoloshin)
|
||||
- Nicolas Fabre (nfabre)
|
||||
- Raul Rodriguez (raul782)
|
||||
@ -964,7 +973,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- ChrisC
|
||||
- Ilya Biryukov
|
||||
- Kim Laï Trinh
|
||||
- Jonatan Männchen
|
||||
- Jason Desrosiers
|
||||
- m.chwedziak
|
||||
- Philip Frank
|
||||
@ -994,7 +1002,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Emmanuel Vella (emmanuel.vella)
|
||||
- Carsten Nielsen (phreaknerd)
|
||||
- Mathieu Rochette
|
||||
- maxime.steinhausser
|
||||
- Jay Severson
|
||||
- René Kerner
|
||||
- Nathaniel Catchpole
|
||||
@ -1044,7 +1051,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Benjamin Bender
|
||||
- Konrad Mohrfeldt
|
||||
- Lance Chen
|
||||
- Andrey Astakhov (aast)
|
||||
- Andrew (drew)
|
||||
- Nikolay Labinskiy (e-moe)
|
||||
- kor3k kor3k (kor3k)
|
||||
@ -1055,6 +1061,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Mephistofeles
|
||||
- Hoffmann András
|
||||
- Olivier
|
||||
- Wesley Lancel
|
||||
- pscheit
|
||||
- Zdeněk Drahoš
|
||||
- Dan Harper
|
||||
@ -1160,6 +1167,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- JakeFr
|
||||
- Simon Sargeant
|
||||
- efeen
|
||||
- Muhammed Akbulut
|
||||
- Michał Dąbrowski (defrag)
|
||||
- Simone Fumagalli (hpatoio)
|
||||
- Brian Graham (incognito)
|
||||
@ -1176,6 +1184,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Artem Lopata (bumz)
|
||||
- Nicole Cordes
|
||||
- Alexey Popkov
|
||||
- Gijs Kunze
|
||||
- Artyom Protaskin
|
||||
- Nathanael d. Noblet
|
||||
- helmer
|
||||
@ -1445,6 +1454,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Matthias Althaus
|
||||
- Michaël VEROUX
|
||||
- Julia
|
||||
- Lin Lu
|
||||
- arduanov
|
||||
- sualko
|
||||
- Nicolas Roudaire
|
||||
|
@ -134,10 +134,7 @@ abstract class AbstractDoctrineExtension extends Extension
|
||||
throw new \InvalidArgumentException(sprintf('Invalid Doctrine mapping path given. Cannot load Doctrine mapping/bundle named "%s".', $mappingName));
|
||||
}
|
||||
|
||||
if (substr($mappingDirectory, 0, 7) !== 'phar://') {
|
||||
$mappingDirectory = realpath($mappingDirectory);
|
||||
}
|
||||
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = $mappingDirectory;
|
||||
$this->drivers[$mappingConfig['type']][$mappingConfig['prefix']] = realpath($mappingDirectory) ?: $mappingDirectory;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -61,7 +61,7 @@ class DoctrineValidationPass implements CompilerPassInterface
|
||||
foreach ($container->getParameter('kernel.bundles') as $bundle) {
|
||||
$reflection = new \ReflectionClass($bundle);
|
||||
if (is_file($file = dirname($reflection->getFileName()).'/'.$validationPath)) {
|
||||
$files[] = realpath($file);
|
||||
$files[] = $file;
|
||||
$container->addResource(new FileResource($file));
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ class TwigExtractor extends AbstractFileExtractor implements ExtractorInterface
|
||||
if ($file instanceof SplFileInfo) {
|
||||
$e->setTemplateName($file->getRelativePathname());
|
||||
} elseif ($file instanceof \SplFileInfo) {
|
||||
$e->setTemplateName($file->getRealPath());
|
||||
$e->setTemplateName($file->getRealPath() ?: $file->getPathname());
|
||||
}
|
||||
|
||||
throw $e;
|
||||
|
@ -52,7 +52,7 @@ class FrameworkExtension extends Extension
|
||||
*/
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||
$loader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__).'/Resources/config'));
|
||||
|
||||
$loader->load('web.xml');
|
||||
$loader->load('services.xml');
|
||||
@ -693,7 +693,7 @@ class FrameworkExtension extends Extension
|
||||
if (class_exists('Symfony\Component\Security\Core\Exception\AuthenticationException')) {
|
||||
$r = new \ReflectionClass('Symfony\Component\Security\Core\Exception\AuthenticationException');
|
||||
|
||||
$dirs[] = dirname($r->getFileName()).'/../Resources/translations';
|
||||
$dirs[] = dirname(dirname($r->getFileName())).'/Resources/translations';
|
||||
}
|
||||
$rootDir = $container->getParameter('kernel.root_dir');
|
||||
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
|
||||
@ -824,21 +824,21 @@ class FrameworkExtension extends Extension
|
||||
$dirname = dirname($reflection->getFileName());
|
||||
|
||||
if (is_file($file = $dirname.'/Resources/config/validation.xml')) {
|
||||
$files[0][] = realpath($file);
|
||||
$files[0][] = $file;
|
||||
$container->addResource(new FileResource($file));
|
||||
}
|
||||
|
||||
if (is_file($file = $dirname.'/Resources/config/validation.yml')) {
|
||||
$files[1][] = realpath($file);
|
||||
$files[1][] = $file;
|
||||
$container->addResource(new FileResource($file));
|
||||
}
|
||||
|
||||
if (is_dir($dir = $dirname.'/Resources/config/validation')) {
|
||||
foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) {
|
||||
$files[0][] = $file->getRealPath();
|
||||
$files[0][] = $file->getPathname();
|
||||
}
|
||||
foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) {
|
||||
$files[1][] = $file->getRealPath();
|
||||
$files[1][] = $file->getPathname();
|
||||
}
|
||||
|
||||
$container->addResource(new DirectoryResource($dir));
|
||||
@ -946,7 +946,7 @@ class FrameworkExtension extends Extension
|
||||
$dirname = dirname($reflection->getFileName());
|
||||
|
||||
if (is_file($file = $dirname.'/Resources/config/serialization.xml')) {
|
||||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array(realpath($file)));
|
||||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file));
|
||||
$definition->setPublic(false);
|
||||
|
||||
$serializerLoaders[] = $definition;
|
||||
@ -954,7 +954,7 @@ class FrameworkExtension extends Extension
|
||||
}
|
||||
|
||||
if (is_file($file = $dirname.'/Resources/config/serialization.yml')) {
|
||||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array(realpath($file)));
|
||||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file));
|
||||
$definition->setPublic(false);
|
||||
|
||||
$serializerLoaders[] = $definition;
|
||||
@ -963,13 +963,13 @@ class FrameworkExtension extends Extension
|
||||
|
||||
if (is_dir($dir = $dirname.'/Resources/config/serialization')) {
|
||||
foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) {
|
||||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file->getRealPath()));
|
||||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file->getPathname()));
|
||||
$definition->setPublic(false);
|
||||
|
||||
$serializerLoaders[] = $definition;
|
||||
}
|
||||
foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) {
|
||||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file->getRealPath()));
|
||||
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\YamlFileLoader', array($file->getPathname()));
|
||||
$definition->setPublic(false);
|
||||
|
||||
$serializerLoaders[] = $definition;
|
||||
@ -1042,7 +1042,7 @@ class FrameworkExtension extends Extension
|
||||
*/
|
||||
public function getXsdValidationBasePath()
|
||||
{
|
||||
return __DIR__.'/../Resources/config/schema';
|
||||
return dirname(__DIR__).'/Resources/config/schema';
|
||||
}
|
||||
|
||||
public function getNamespace()
|
||||
|
@ -371,11 +371,11 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
// Testing symfony/framework-bundle with deps=high
|
||||
$this->assertStringEndsWith('symfony'.DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
|
||||
}
|
||||
$this->assertStringEndsWith('TestBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'validation.xml', $xmlMappings[1]);
|
||||
$this->assertStringEndsWith('TestBundle/Resources/config/validation.xml', $xmlMappings[1]);
|
||||
|
||||
$yamlMappings = $calls[4][1][0];
|
||||
$this->assertCount(1, $yamlMappings);
|
||||
$this->assertStringEndsWith('TestBundle'.DIRECTORY_SEPARATOR.'Resources'.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'validation.yml', $yamlMappings[0]);
|
||||
$this->assertStringEndsWith('TestBundle/Resources/config/validation.yml', $yamlMappings[0]);
|
||||
}
|
||||
|
||||
public function testValidationNoStaticMethod()
|
||||
|
@ -31,7 +31,7 @@
|
||||
"symfony/framework-bundle": "~2.8",
|
||||
"symfony/http-foundation": "~2.4|~3.0.0",
|
||||
"symfony/twig-bundle": "~2.7|~3.1.0",
|
||||
"symfony/twig-bridge": "~2.7|~3.1.0",
|
||||
"symfony/twig-bridge": "~2.7,>=2.7.4|~3.1.0",
|
||||
"symfony/process": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/validator": "~2.5|~3.0.0",
|
||||
"symfony/yaml": "~2.0,>=2.0.5|~3.0.0",
|
||||
|
@ -58,6 +58,7 @@ class FilesystemLoader extends \Twig_Loader_Filesystem
|
||||
* Otherwise the template is located using the locator from the twig library.
|
||||
*
|
||||
* @param string|TemplateReferenceInterface $template The template
|
||||
* @param bool $throw When true, a \Twig_Error_Loader exception will be thrown if a template could not be found
|
||||
*
|
||||
* @return string The path to the template file
|
||||
*
|
||||
@ -87,7 +88,11 @@ class FilesystemLoader extends \Twig_Loader_Filesystem
|
||||
}
|
||||
|
||||
if (false === $file || null === $file) {
|
||||
throw $twigLoaderException;
|
||||
if ($throw) {
|
||||
throw $twigLoaderException;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->cache[$logicalName] = $file;
|
||||
|
@ -115,4 +115,17 @@ class FilesystemLoaderTest extends TestCase
|
||||
$method->setAccessible(true);
|
||||
$method->invoke($loader, 'name.format.engine');
|
||||
}
|
||||
|
||||
public function testTwigSoftErrorIfTemplateDoesNotExist()
|
||||
{
|
||||
$parser = $this->getMock('Symfony\Component\Templating\TemplateNameParserInterface');
|
||||
$locator = $this->getMock('Symfony\Component\Config\FileLocatorInterface');
|
||||
|
||||
$loader = new FilesystemLoader($locator, $parser);
|
||||
$loader->addPath(__DIR__.'/../DependencyInjection/Fixtures/Resources/views');
|
||||
|
||||
$method = new \ReflectionMethod('Symfony\Bundle\TwigBundle\Loader\FilesystemLoader', 'findTemplate');
|
||||
$method->setAccessible(true);
|
||||
$this->assertFalse($method->invoke($loader, 'name.format.engine', false));
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ class ClassCollectionLoader
|
||||
if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) {
|
||||
throw new \RuntimeException(sprintf('Class Collection Loader was not able to create directory "%s"', $cacheDir));
|
||||
}
|
||||
$cacheDir = rtrim(realpath($cacheDir), '/'.DIRECTORY_SEPARATOR);
|
||||
$cacheDir = rtrim(realpath($cacheDir) ?: $cacheDir, '/'.DIRECTORY_SEPARATOR);
|
||||
$cache = $cacheDir.DIRECTORY_SEPARATOR.$name.$extension;
|
||||
|
||||
// auto-reload
|
||||
|
@ -64,7 +64,7 @@ class ClassMapGenerator
|
||||
continue;
|
||||
}
|
||||
|
||||
$path = $file->getRealPath();
|
||||
$path = $file->getRealPath() ?: $file->getPathname();
|
||||
|
||||
if (pathinfo($path, PATHINFO_EXTENSION) !== 'php') {
|
||||
continue;
|
||||
|
@ -32,7 +32,7 @@ class FileResource implements SelfCheckingResourceInterface, \Serializable
|
||||
*/
|
||||
public function __construct($resource)
|
||||
{
|
||||
$this->resource = realpath($resource);
|
||||
$this->resource = realpath($resource) ?: (file_exists($resource) ? $resource : false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,7 +44,7 @@ class DateRangeFilterIterator extends FilterIterator
|
||||
{
|
||||
$fileinfo = $this->current();
|
||||
|
||||
if (!file_exists($fileinfo->getRealPath())) {
|
||||
if (!file_exists($fileinfo->getPathname())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ class SortableIterator implements \IteratorAggregate
|
||||
|
||||
if (self::SORT_BY_NAME === $sort) {
|
||||
$this->sort = function ($a, $b) {
|
||||
return strcmp($a->getRealpath(), $b->getRealpath());
|
||||
return strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname());
|
||||
};
|
||||
} elseif (self::SORT_BY_TYPE === $sort) {
|
||||
$this->sort = function ($a, $b) {
|
||||
@ -51,7 +51,7 @@ class SortableIterator implements \IteratorAggregate
|
||||
return 1;
|
||||
}
|
||||
|
||||
return strcmp($a->getRealpath(), $b->getRealpath());
|
||||
return strcmp($a->getRealpath() ?: $a->getPathname(), $b->getRealpath() ?: $b->getPathname());
|
||||
};
|
||||
} elseif (self::SORT_BY_ACCESSED_TIME === $sort) {
|
||||
$this->sort = function ($a, $b) {
|
||||
|
@ -244,7 +244,7 @@ final class Intl
|
||||
*/
|
||||
public static function getDataDirectory()
|
||||
{
|
||||
return realpath(__DIR__.'/Resources/data');
|
||||
return __DIR__.'/Resources/data';
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user