diff --git a/CHANGELOG-2.3.md b/CHANGELOG-2.3.md index 7b7a4b3add..e94f44eb39 100644 --- a/CHANGELOG-2.3.md +++ b/CHANGELOG-2.3.md @@ -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.22 (2014-11-20) + + * bug #12525 [Bundle][FrameworkBundle] be smarter when guessing the document root (xabbuh) + * bug #12296 [SecurityBundle] Authentication entry point is only registered with firewall exception listener, not with authentication listeners (rjkip) + * bug #12393 [DependencyInjection] inlined factory not referenced (boekkooi) + * bug #12436 [Filesystem] Fixed case for empty folder (yosmanyga) + * bug #12370 [Yaml] improve error message for multiple documents (xabbuh) + * bug #12170 [Form] fix form handling with OPTIONS request method (Tobion) + * bug #12235 [Validator] Fixed Regex::getHtmlPattern() to work with complex and negated patterns (webmozart) + * bug #12326 [Session] remove invalid hack in session regenerate (Tobion) + * bug #12341 [Kernel] ensure session is saved before sending response (Tobion) + * bug #12329 [Routing] serialize the compiled route to speed things up (Tobion) + * bug #12316 Break infinite loop while resolving aliases (chx) + * bug #12313 [Security][listener] change priority of switchuser (aitboudad) + * 2.3.21 (2014-10-24) * bug #11696 [Form] Fix #11694 - Enforce options value type check in some form types (kix) diff --git a/CHANGELOG-2.5.md b/CHANGELOG-2.5.md index 41670dad3a..1e76efce7c 100644 --- a/CHANGELOG-2.5.md +++ b/CHANGELOG-2.5.md @@ -7,6 +7,26 @@ in 2.5 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.5.0...v2.5.1 +* 2.5.7 (2014-11-20) + + * bug #12525 [Bundle][FrameworkBundle] be smarter when guessing the document root (xabbuh) + * bug #12296 [SecurityBundle] Authentication entry point is only registered with firewall exception listener, not with authentication listeners (rjkip) + * bug #12489 [FrameworkBundle] Fix server run in case the router script does not exist (romainneutron) + * bug #12443 [HttpKernel] Adding support for invokable controllers in the RequestDataCollector (jameshalsall) + * bug #12393 [DependencyInjection] inlined factory not referenced (boekkooi) + * bug #12436 [Filesystem] Fixed case for empty folder (yosmanyga) + * bug #12397 [Routing] fix BC (nicolas-grekas) + * bug #12382 [Routing] removed errors from git (HeinZawHtet) + * bug #12370 [Yaml] improve error message for multiple documents (xabbuh) + * bug #12170 [Form] fix form handling with OPTIONS request method (Tobion) + * bug #12235 [Validator] Fixed Regex::getHtmlPattern() to work with complex and negated patterns (webmozart) + * bug #12326 [Session] remove invalid hack in session regenerate (Tobion) + * bug #12341 [Kernel] ensure session is saved before sending response (Tobion) + * bug #12329 [Routing] serialize the compiled route to speed things up (Tobion) + * bug #12291 [Form] Fixed usage of "name" variable in form_start block (webmozart) + * bug #12316 Break infinite loop while resolving aliases (chx) + * bug #12313 [Security][listener] change priority of switchuser (aitboudad) + * 2.5.6 (2014-10-24) * bug #11696 [Form] Fix #11694 - Enforce options value type check in some form types (kix) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index ce486c92ec..cde155aa47 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -24,9 +24,9 @@ Symfony2 is the result of the work of many people who made the code better - Benjamin Eberlei (beberlei) - Igor Wiedler (igorw) - Hugo Hamon (hhamon) + - Nicolas Grekas (nicolas-grekas) - Martin Hasoň (hason) - Eriksen Costa (eriksencosta) - - Nicolas Grekas (nicolas-grekas) - Christian Flothmann (xabbuh) - Jonathan Wage (jwage) - Grégoire Pineau (lyrixx) @@ -40,8 +40,8 @@ Symfony2 is the result of the work of many people who made the code better - Saša Stamenković (umpirsky) - Miha Vrhovnik - Henrik Bjørnskov (henrikbjorn) - - Konstantin Kudryashov (everzet) - Wouter De Jong (wouterj) + - Konstantin Kudryashov (everzet) - Bilal Amarni (bamarni) - Florin Patan (florinpatan) - Eric Clemmons (ericclemmons) @@ -65,8 +65,8 @@ Symfony2 is the result of the work of many people who made the code better - Luis Cordova (cordoval) - Arnaud Le Blanc (arnaud-lb) - Kevin Bond (kbond) - - Tim Nagel (merk) - Ait Boudad Abdellatif (aitboudad) + - Tim Nagel (merk) - Brice BERNARD (brikou) - marc.weistroff - lenar @@ -120,6 +120,7 @@ Symfony2 is the result of the work of many people who made the code better - Andreas Hucks (meandmymonkey) - Andréia Bohner (andreia) - Noel Guilbert (noel) + - Peter Rehm (rpet) - Charles Sarrazin (csarrazi) - bronze1man - sun (sun) @@ -138,7 +139,6 @@ Symfony2 is the result of the work of many people who made the code better - Sven Paulus (subsven) - Lars Strojny (lstrojny) - Joel Wurtz (brouznouf) - - Peter Rehm (rpet) - Rui Marinho (ruimarinho) - Matthias Pigulla (mpdude) - Julien Brochet (mewt) @@ -173,6 +173,7 @@ Symfony2 is the result of the work of many people who made the code better - jdhoek - Nikita Konstantinov - Wodor Wodorski + - Iltar van der Berg - julien pauli (jpauli) - Beau Simensen (simensen) - Robert Kiss (kepten) @@ -185,6 +186,7 @@ Symfony2 is the result of the work of many people who made the code better - Chris Smith (cs278) - Florian Klein (docteurklein) - Manuel Kiessling (manuelkiessling) + - Daniel Wehner - Atsuhiro KUBO (iteman) - Andrew Moore (finewolf) - Bertrand Zuchuat (garfield-fr) @@ -207,7 +209,6 @@ Symfony2 is the result of the work of many people who made the code better - janschoenherr - Marco Pivetta (ocramius) - Ricard Clau (ricardclau) - - Iltar van der Berg - Erin Millard - John Kary (johnkary) - Matthew Lewinski (lewinski) @@ -246,6 +247,7 @@ Symfony2 is the result of the work of many people who made the code better - Shein Alexey - Joe Lencioni - Kai + - Karoly Negyesi (chx) - Xavier HAUSHERR - Albert Jessurum (ajessu) - Laszlo Korte @@ -301,7 +303,6 @@ Symfony2 is the result of the work of many people who made the code better - Iker Ibarguren (ikerib) - Ricardo Oliveira (ricardolotr) - ondrowan - - Daniel Wehner - Evan S Kaufman (evanskaufman) - mcben - Maks Slesarenko @@ -311,6 +312,7 @@ Symfony2 is the result of the work of many people who made the code better - Ioan Negulescu - Jakub Škvára (jskvara) - Andrew Udvare (audvare) + - Sarah Khalil (saro0h) - alexpods - Erik Trapman (eriktrapman) - De Cock Xavier (xdecock) @@ -334,8 +336,8 @@ Symfony2 is the result of the work of many people who made the code better - Lenar Lõhmus - Zach Badgett (zachbadgett) - Aurélien Fredouelle - - Karoly Negyesi (chx) - Pavel Campr (pcampr) + - Disquedur - Geoffrey Tran (geoff) - Jan Behrens - Sebastian Krebs @@ -363,6 +365,7 @@ Symfony2 is the result of the work of many people who made the code better - Maxime Douailin - Javier López (loalf) - Dustin Dobervich (dustin10) + - Warnar Boekkooi - Alexander M. Turek (derrabus) - Sebastian Marek (proofek) - Erkhembayar Gantulga (erheme318) @@ -421,6 +424,7 @@ Symfony2 is the result of the work of many people who made the code better - Venu - Lars Vierbergen - Mark Challoner + - Dennis Hotson - Andrew Tchircoff (andrewtch) - michaelwilliams - 1emming @@ -431,6 +435,7 @@ Symfony2 is the result of the work of many people who made the code better - John Bohn (jbohn) - Andrew Hilobok (hilobok) - Christian Soronellas (theunic) + - Yosmany Garcia (yosmanyga) - Daniel Beyer - Jérôme Vieilledent (lolautruche) - Degory Valentine @@ -480,9 +485,9 @@ Symfony2 is the result of the work of many people who made the code better - grizlik - Derek ROTH - Shin Ohno (ganchiku) + - Geert De Deckere (geertdd) - Jan Kramer (jankramer) - abdul malik ikhsan (samsonasik) - - Sarah Khalil (saro0h) - Timothée Barray (tyx) - Benjamin Laugueux (yzalis) - Christian Morgan @@ -531,6 +536,7 @@ Symfony2 is the result of the work of many people who made the code better - Radosław Benkel - ttomor - Mei Gwilym (meigwilym) + - Michael H. Arieli (excelwebzone) - Luciano Mammino (loige) - fabios - Sander Coolen (scoolen) @@ -540,6 +546,7 @@ Symfony2 is the result of the work of many people who made the code better - Anton Babenko (antonbabenko) - Irmantas Šiupšinskas (irmantas) - Danilo Silva + - Stepan Anchugov (kix) - Zachary Tong (polyfractal) - Hryhorii Hrebiniuk - dantleech @@ -567,7 +574,6 @@ Symfony2 is the result of the work of many people who made the code better - Boris Vujicic (boris.vujicic) - Max Beutel - Catalin Dan - - Warnar Boekkooi - Piotr Antosik (antek88) - Artem Lopata - Marcos Quesada (marcos_quesada) @@ -592,6 +598,7 @@ Symfony2 is the result of the work of many people who made the code better - Daniel Mecke (daniel_mecke) - Matteo Giachino (matteosister) - Alex Demchenko (pilot) + - Tadas Gliaubicas (tadcka) - Benoit Garret - Thomas Royer (cydonia7) - DerManoMann @@ -708,6 +715,7 @@ Symfony2 is the result of the work of many people who made the code better - Max Summe - WedgeSama - Felds Liscia + - James Halsall (jaitsu) - Maxime Veber (nek-) - Tadcka - Beth Binkovitz @@ -734,7 +742,6 @@ Symfony2 is the result of the work of many people who made the code better - r1pp3rj4ck - Robert Queck - mlively - - Dennis Hotson - Fabian Steiner (fabstei) - Klaus Silveira (klaussilveira) - Thomas Chmielowiec (chmielot) @@ -780,6 +787,7 @@ Symfony2 is the result of the work of many people who made the code better - Martin Eckhardt - Denis Zunke - Jonathan Poston + - Adrian Olek (adrianolek) - Przemysław Piechota (kibao) - Leonid Terentyev (li0n) - Adam Prager (padam87) @@ -800,7 +808,6 @@ Symfony2 is the result of the work of many people who made the code better - Paul Seiffert (seiffert) - Vasily Khayrulin (sirian) - Stefan Koopmanschap (skoop) - - Yosmany Garcia (yosmanyga) - Ivan Kurnosov - stloyd - Chris Tickner @@ -891,6 +898,7 @@ Symfony2 is the result of the work of many people who made the code better - Joel Marcey - David Christmann - root + - James Hudson - Tom Maguire - David Zuelke - Pierre Rineau @@ -906,6 +914,7 @@ Symfony2 is the result of the work of many people who made the code better - grifx - Robert Campbell - Matt Lehner + - Hein Zaw Htet™ - Ruben Kruiswijk - Michael J - Alex Pods @@ -944,7 +953,9 @@ Symfony2 is the result of the work of many people who made the code better - Vincent Composieux (eko) - Franz Liedke (franzliedke) - gondo (gondo) + - Gusakov Nikita (hell0w0rd) - Osman Üngür (import) + - Jelle Bekker (jbekker) - Ian Jenkins (jenkoian) - Jorge Martin (jorgemartind) - Kevin Herrera (kherge) @@ -973,6 +984,7 @@ Symfony2 is the result of the work of many people who made the code better - Daniele Cesarini (ijanki) - Ismail Asci (ismailasci) - Simon CONSTANS (kosssi) + - Kristof Van Cauwenbergh (kristofvc) - Ramon Henrique Ornelas (ramonornela) - Till Klampaeckel (till) - Tobias Weinert (tweini) @@ -1003,6 +1015,7 @@ Symfony2 is the result of the work of many people who made the code better - patrick-mcdougle - Dariusz Czech - Anonymous User + - Eric J. Duran - cmfcmf - Drew Butler - Steve Müller @@ -1118,6 +1131,7 @@ Symfony2 is the result of the work of many people who made the code better - Vincent (vincent1870) - Eugene Babushkin (warl) - Xavier Amado (xamado) + - Dawid Pakuła (zulusx) - Florent Cailhol - szymek - craigmarvelley diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php index d538ae6f87..7843e7ddd3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php @@ -127,6 +127,9 @@ EOF $tempKernel = $this->getTempKernel($realKernel, $namespace, $realKernelClass, $warmupDir); $tempKernel->boot(); + $tempKernelReflection = new \ReflectionObject($tempKernel); + $tempKernelFile = $tempKernelReflection->getFileName(); + // warmup temporary dir $warmer = $tempKernel->getContainer()->get('cache_warmer'); if ($enableOptionalWarmers) { @@ -162,6 +165,9 @@ EOF file_put_contents(str_replace($search, $replace, $file), $content); unlink($file); } + + // remove temp kernel file after cache warmed up + @unlink($tempKernelFile); } /** @@ -201,13 +207,30 @@ namespace $namespace { return '$rootDir'; } + + protected function buildContainer() + { + \$container = parent::buildContainer(); + + // filter container's resources, removing reference to temp kernel file + \$resources = \$container->getResources(); + \$filteredResources = array(); + foreach (\$resources as \$resource) { + if ((string) \$resource !== __FILE__) { + \$filteredResources[] = \$resource; + } + } + + \$container->setResources(\$filteredResources); + + return \$container; + } } } EOF; $this->getContainer()->get('filesystem')->mkdir($warmupDir); file_put_contents($file = $warmupDir.'/kernel.tmp', $code); require_once $file; - @unlink($file); $class = "$namespace\\$class"; return new $class($parent->getEnvironment(), $parent->isDebug()); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php new file mode 100644 index 0000000000..78ab561df1 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php @@ -0,0 +1,78 @@ +fs = new Filesystem(); + $this->kernel = new TestAppKernel('test', true); + $this->rootDir = sys_get_temp_dir().DIRECTORY_SEPARATOR.uniqid('sf2_cache_'); + $this->kernel->setRootDir($this->rootDir); + $this->fs->mkdir($this->rootDir); + } + + protected function tearDown() + { + $this->fs->remove($this->rootDir); + } + + public function testCacheIsFreshAfterCacheClearedWithWarmup() + { + $input = new ArrayInput(array('cache:clear')); + $application = new Application($this->kernel); + $application->setCatchExceptions(false); + + $application->doRun($input, new NullOutput()); + + // Ensure that all *.meta files are fresh + $finder = new Finder(); + $metaFiles = $finder->files()->in($this->kernel->getCacheDir())->name('*.php.meta'); + // simply check that cache is warmed up + $this->assertGreaterThanOrEqual(1, count($metaFiles)); + foreach ($metaFiles as $file) { + $configCache = new ConfigCache(substr($file, 0, -5), true); + $this->assertTrue( + $configCache->isFresh(), + sprintf( + 'Meta file "%s" is not fresh', + (string) $file + ) + ); + } + + // check that app kernel file present in meta file of container's cache + $containerRef = new \ReflectionObject($this->kernel->getContainer()); + $containerFile = $containerRef->getFileName(); + $containerMetaFile = $containerFile.'.meta'; + $kernelRef = new \ReflectionObject($this->kernel); + $kernelFile = $kernelRef->getFileName(); + /** @var ResourceInterface[] $meta */ + $meta = unserialize(file_get_contents($containerMetaFile)); + $found = false; + foreach ($meta as $resource) { + if ((string) $resource === $kernelFile) { + $found = true; + break; + } + } + $this->assertTrue($found, 'Kernel file should present as resource'); + } +} diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php new file mode 100644 index 0000000000..da835dfd4d --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php @@ -0,0 +1,27 @@ +rootDir = $rootDir; + } + + public function registerContainerConfiguration(LoaderInterface $loader) + { + $loader->load(__DIR__.DIRECTORY_SEPARATOR.'config.yml'); + } +} diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/config.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/config.yml new file mode 100644 index 0000000000..68f8d04061 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/config.yml @@ -0,0 +1,2 @@ +framework: + secret: test diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig index cd30a30a6b..619469e415 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/form.html.twig @@ -420,7 +420,7 @@ {% else %}
{% endif %} - {{ name }} {% if data.type is not empty %}[{{ data.type }}]{% endif %} + {{ name|default('(no name)') }} {% if data.type is not empty %}[{{ data.type }}]{% endif %} {% if data.errors is defined and data.errors|length > 0 %}
{{ data.errors|length }}
{% endif %} @@ -437,9 +437,9 @@ {% endmacro %} {% macro form_tree_details(name, data, forms_by_hash) %} -
+

- {{ name }} + {{ name|default('(no name)') }} {% if data.type_class is defined %} [{{ data.type }}] {% endif %} diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index 1871dde350..0bc7e687e0 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -726,7 +726,19 @@ class Request */ public function get($key, $default = null, $deep = false) { - return $this->query->get($key, $this->attributes->get($key, $this->request->get($key, $default, $deep), $deep), $deep); + if ($this !== $result = $this->query->get($key, $this, $deep)) { + return $result; + } + + if ($this !== $result = $this->attributes->get($key, $this, $deep)) { + return $result; + } + + if ($this !== $result = $this->request->get($key, $this, $deep)) { + return $result; + } + + return $default; } /**