diff --git a/CHANGELOG-3.2.md b/CHANGELOG-3.2.md index de1e0fd980928..5542e4160d1c3 100644 --- a/CHANGELOG-3.2.md +++ b/CHANGELOG-3.2.md @@ -7,6 +7,58 @@ in 3.2 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/v3.2.0...v3.2.1 +* 3.2.10 (2017-07-04) + + * bug #23366 [FrameworkBundle] Don't get() private services from debug:router (chalasr) + * bug #23341 [DoctrineBridge][Security][Validator] do not validate empty values (xabbuh) + * bug #23274 Display a better error design when the toolbar cannot be displayed (yceruto) + * bug #23296 [WebProfilerBundle] Fix css trick used for offsetting html anchor from fixed header (ogizanagi) + * bug #23333 [PropertyAccess] Fix TypeError discard (dunglas) + * bug #23326 [Cache] fix cleanup of expired items for PdoAdapter (dmaicher) + * bug #23345 [Console] fix description of INF default values (xabbuh) + * bug #23299 [Workflow] Added more events to the announce function (Nyholm) + * bug #23279 Don't call count on non countable object (pierredup) + * bug #23283 [TwigBundle] add back exception check (xabbuh) + * bug #23268 Show exception is checked twice in ExceptionController of twig (gmponos) + * bug #23266 Display a better error message when the toolbar cannot be displayed (javiereguiluz) + * bug #23271 [FrameworkBundle] allow SSI fragments configuration in XML files (xabbuh) + * bug #23254 [Form][TwigBridge] render hidden _method field in form_rest() (xabbuh) + * bug #23250 [Translation] return fallback locales whenever possible (xabbuh) + * bug #23240 [Console] Fix catching exception type in QuestionHelper (voronkovich) + * bug #23229 [WebProfilerBundle] Eliminate line wrap on count column (routing) (e-moe) + * bug #22732 [Security] fix switch user _exit without having current token (dmaicher) + * bug #22730 [FrameworkBundle] Sessions: configurable "use_strict_mode" option for NativeSessionStorage (MacDada) + * bug #23195 [FrameworkBundle] [Command] Clean bundle directory, fixes #23177 (NicolasPion) + * bug #23052 [TwigBundle] Add Content-Type header for exception response (rchoquet) + * bug #23199 Reset redirectCount when throwing exception (hvanoch) + * bug #23186 [TwigBundle] Move template.xml loading to a compiler pass (ogizanagi) + * bug #23130 Keep s-maxage when expiry and validation are used in combination (mpdude) + * bug #23129 Fix two edge cases in ResponseCacheStrategy (mpdude) + * feature #22636 [Routing] Expose request in route conditions, if needed and possible (ro0NL) + * bug #22636 [Routing] Expose request in route conditions, if needed and possible (ro0NL) + * bug #22943 [SecurityBundle] Move cache of the firewall context into the request parameters (GromNaN) + * bug #23057 [Translation][FrameworkBundle] Fix resource loading order inconsistency reported in #23034 (mpdude) + * bug #23092 [Filesystem] added workaround in Filesystem::rename for PHP bug (VolCh) + * bug #23128 [HttpFoundation] fix for Support for new 7.1 session options (vincentaubert) + * bug #23176 [VarDumper] fixes (nicolas-grekas) + * bug #23100 [PropertyAccess] Do not silence TypeErrors from client code. (tsufeki) + * bug #23156 [PropertyAccess] Fix Usage with anonymous classes (mablae) + * bug #23091 [Cache] ApcuAdapter::isSupported() should return true when apc.enable_cli=Off (nicolas-grekas) + * bug #22953 #22839 - changed debug toolbar dump section to relative and use full window width (mkurzeja) + * bug #23086 [FrameworkBundle] Fix perf issue in CacheClearCommand::warmup() (nicolas-grekas) + * bug #23098 Cache ipCheck (2.7) (gonzalovilaseca) + * bug #23069 [SecurityBundle] Show unique Inherited roles in profile panel (yceruto) + * bug #23073 [TwigBridge] Fix namespaced classes (ogizanagi) + * bug #23063 [Cache] Fix extensibility of TagAwareAdapter::TAGS_PREFIX (wucdbm) + * bug #22936 [Form] Mix attr option between guessed options and user options (yceruto) + * bug #22976 [DependencyInjection] Use more clear message when unused environment variables detected (voronkovich) + * bug #23045 [Cache] fix Redis scheme detection (xabbuh) + * bug #22988 [PropertyInfo][DoctrineBridge] The bigint Doctrine's type must be converted to string (dunglas) + * bug #23014 Fix optional cache warmers are always instantiated whereas they should be lazy-loaded (romainneutron) + * bug #23024 [EventDispatcher] Fix ContainerAwareEventDispatcher::hasListeners(null) (nicolas-grekas) + * bug #22996 [Form] Fix \IntlDateFormatter timezone parameter usage to bypass PHP bug #66323 (romainneutron) + * bug #22994 Harden the debugging of Twig filters and functions (stof) + * 3.2.9 (2017-05-29) * bug #22847 [Console] ChoiceQuestion must have choices (ro0NL) diff --git a/CHANGELOG-3.3.md b/CHANGELOG-3.3.md index 1817eff60299e..b6113a82ad279 100644 --- a/CHANGELOG-3.3.md +++ b/CHANGELOG-3.3.md @@ -7,6 +7,14 @@ in 3.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/v3.3.0...v3.3.1 +* 3.3.4 (2017-07-05) + + * bug #23413 [VarDumper] Reduce size of serialized Data objects (nicolas-grekas) + * bug #23385 [DoctrineBridge] Fix resetting entity managers with case sensitive id (chalasr) + * bug #23390 [Cache] Handle APCu failures gracefully (nicolas-grekas) + * bug #23371 [FrameworkBundle] 3.3: Don't get() private services from debug:router (ogizanagi) + * bug #23378 [FrameworkBundle] Do not remove files from assets dir (1ed) + * 3.3.3 (2017-07-04) * bug #23366 [FrameworkBundle] Don't get() private services from debug:router (chalasr) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 2ea3ea63b87fd..3432439481471 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -20,11 +20,11 @@ Symfony is the result of the work of many people who made the code better - Javier Eguiluz (javier.eguiluz) - Hugo Hamon (hhamon) - Abdellatif Ait boudad (aitboudad) + - Maxime Steinhausser (ogizanagi) + - Robin Chalas (chalas_r) - Romain Neutron (romain) - Pascal Borreli (pborreli) - Wouter De Jong (wouterj) - - Robin Chalas (chalas_r) - - Maxime Steinhausser (ogizanagi) - Grégoire Pineau (lyrixx) - Joseph Bielawski (stloyd) - Karma Dordrak (drak) @@ -38,8 +38,8 @@ Symfony is the result of the work of many people who made the code better - Jules Pietri (heah) - Roland Franssen (ro0) - Sarah Khalil (saro0h) - - Jonathan Wage (jwage) - Guilhem Niot (energetick) + - Jonathan Wage (jwage) - Diego Saint Esteben (dosten) - Alexandre Salomé (alexandresalome) - William Durand (couac) @@ -48,24 +48,24 @@ Symfony is the result of the work of many people who made the code better - stealth35 ‏ (stealth35) - Alexander Mols (asm89) - Bulat Shakirzyanov (avalanche123) - - Peter Rehm (rpet) - Iltar van der Berg (kjarli) + - Peter Rehm (rpet) - Saša Stamenković (umpirsky) - Henrik Bjørnskov (henrikbjorn) - Miha Vrhovnik - Diego Saint Esteben (dii3g0) - Konstantin Kudryashov (everzet) + - Matthias Pigulla (mpdude) - Bilal Amarni (bamarni) - Florin Patan (florinpatan) - - Matthias Pigulla (mpdude) + - Gábor Egyed (1ed) - Kevin Bond (kbond) - Andrej Hudec (pulzarraider) - - Gábor Egyed (1ed) + - Pierre du Plessis (pierredup) - Michel Weimerskirch (mweimerskirch) - Eric Clemmons (ericclemmons) - Charles Sarrazin (csarrazi) - Christian Raue - - Pierre du Plessis (pierredup) - Arnout Boks (aboks) - Deni - Henrik Westphal (snc) @@ -83,25 +83,27 @@ Symfony is the result of the work of many people who made the code better - Toni Uebernickel (havvg) - Bart van den Burg (burgov) - Jordan Alliot (jalliot) + - Jérôme Tamarelle (gromnan) - John Wards (johnwards) - Dariusz Ruminski - Fran Moreno (franmomu) - Antoine Hérault (herzult) - - Jérôme Tamarelle (gromnan) - Paráda József (paradajozsef) - Arnaud Le Blanc (arnaud-lb) - Maxime STEINHAUSSER + - Alexander M. Turek (derrabus) - Michal Piotrowski (eventhorizon) - Issei Murasawa (issei_m) - Tim Nagel (merk) - Brice BERNARD (brikou) - - Alexander M. Turek (derrabus) - Baptiste Clavié (talus) + - Vladimir Reznichenko (kalessil) - marc.weistroff - lenar - Włodzimierz Gajda (gajdaw) - - Vladimir Reznichenko (kalessil) + - Yonel Ceruto González (yonelceruto) - Alexander Schwenn (xelaris) + - Jacob Dreesen (jdreesen) - Florian Voutzinos (florianv) - Colin Frei - Adrien Brault (adrienbrault) @@ -109,10 +111,8 @@ Symfony is the result of the work of many people who made the code better - Peter Kokot (maastermedia) - David Buchmann (dbu) - excelwebzone - - Jacob Dreesen (jdreesen) - Tobias Nyholm (tobias) - Tomáš Votruba (tomas_votruba) - - Yonel Ceruto González (yonelceruto) - Fabien Pennequin (fabienpennequin) - Gordon Franke (gimler) - Eric GELOEN (gelo) @@ -124,13 +124,13 @@ Symfony is the result of the work of many people who made the code better - Sebastiaan Stok (sstok) - Stefano Sala (stefano.sala) - Evgeniy (ewgraf) + - Vincent AUBERT (vincent) - Juti Noppornpitak (shiroyuki) - Tigran Azatyan (tigranazatyan) - Sebastian Hörl (blogsh) - Daniel Gomes (danielcsgomes) - Hidenori Goto (hidenorigoto) - Guilherme Blanco (guilhermeblanco) - - Vincent AUBERT (vincent) - Pablo Godel (pgodel) - Jérémie Augustin (jaugustin) - Andréia Bohner (andreia) @@ -147,6 +147,7 @@ Symfony is the result of the work of many people who made the code better - Thomas Rabaix (rande) - Rouven Weßling (realityking) - Teoh Han Hui (teohhanhui) + - David Maicher (dmaicher) - Jérôme Vasseur (jvasseur) - Clemens Tolboom - Helmer Aaviksoo @@ -154,16 +155,16 @@ Symfony is the result of the work of many people who made the code better - Hiromi Hishida (77web) - Matthieu Ouellette-Vachon (maoueh) - Michał Pipa (michal.pipa) + - Dawid Nowak - Amal Raghav (kertz) - Jonathan Ingram (jonathaningram) - Artur Kotyrba - - David Maicher (dmaicher) - jeremyFreeAgent (Jérémy Romey) (jeremyfreeagent) - James Halsall (jaitsu) - Warnar Boekkooi (boekkooi) - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) - - Dawid Nowak + - Lars Strojny (lstrojny) - Possum - Dorian Villet (gnutix) - Richard Miller (mr_r_miller) @@ -176,12 +177,12 @@ Symfony is the result of the work of many people who made the code better - Chris Wilkinson (thewilkybarkid) - Andreas Hucks (meandmymonkey) - Noel Guilbert (noel) - - Lars Strojny (lstrojny) - Stepan Anchugov (kix) - bronze1man - Daniel Espendiller - sun (sun) - Larry Garfield (crell) + - Oleg Voronkovich - Martin Schuhfuß (usefulthink) - apetitpa - Matthieu Bontemps (mbontemps) @@ -244,7 +245,6 @@ Symfony is the result of the work of many people who made the code better - Uwe Jäger (uwej711) - Eugene Leonovich (rybakit) - Filippo Tessarotto - - Oleg Voronkovich - Joseph Rouff (rouffj) - Félix Labrecque (woodspire) - GordonsLondon @@ -296,6 +296,7 @@ Symfony is the result of the work of many people who made the code better - Victor Bocharsky (bocharsky_bw) - Jan Decavele (jandc) - Gustavo Piltcher + - Nikolay Labinskiy (e-moe) - Stepan Tanasiychuk (stfalcon) - Tiago Ribeiro (fixe) - Hidde Boomsma (hboomsma) @@ -361,7 +362,6 @@ Symfony is the result of the work of many people who made the code better - Endre Fejes - Tobias Naumann (tna) - Daniel Beyer - - Nikolay Labinskiy (e-moe) - Shein Alexey - Romain Gautier (mykiwi) - Joe Lencioni @@ -611,6 +611,7 @@ Symfony is the result of the work of many people who made the code better - Kevin (oxfouzer) - Paweł Wacławczyk (pwc) - Oleg Zinchenko (cystbear) + - Baptiste Meyer (meyerbaptiste) - Johannes Klauss (cloppy) - Evan Villemez - fzerorubigd @@ -673,6 +674,7 @@ Symfony is the result of the work of many people who made the code better - Benoit Lévêque (benoit_leveque) - Jeroen Fiege (fieg) - Krzysiek Łabuś + - George Mponos (gmponos) - Xavier Lacot (xavier) - possum - Denis Zunke (donalberto) @@ -736,6 +738,7 @@ Symfony is the result of the work of many people who made the code better - Omar Yepez (oyepez003) - mwsaz - Jelle Kapitein + - Ben Scott - Benoît Bourgeois - mantulo - corphi @@ -817,6 +820,7 @@ Symfony is the result of the work of many people who made the code better - ttomor - Mei Gwilym (meigwilym) - Michael H. Arieli (excelwebzone) + - Tom Panier (neemzy) - Fred Cox - Luciano Mammino (loige) - fabios @@ -852,6 +856,7 @@ Symfony is the result of the work of many people who made the code better - Máximo Cuadros (mcuadros) - tamirvs - julien.galenski + - Israel J. Carberry - Bob van de Vijver - Christian Neff - Per Sandström (per) @@ -890,7 +895,6 @@ Symfony is the result of the work of many people who made the code better - Eddie Jaoude - Antanas Arvasevicius - Haritz Iturbe (hizai) - - Baptiste Meyer (meyerbaptiste) - Nerijus Arlauskas (nercury) - SPolischook - Diego Sapriza @@ -912,8 +916,10 @@ Symfony is the result of the work of many people who made the code better - Marcin Chwedziak - hjkl - Tony Cosentino (tony-co) + - Dan Wilga - Alexander Cheprasov - Rodrigo Díez Villamuera (rodrigodiez) + - Malte Blättermann - e-ivanov - Jochen Bayer (jocl) - Jeremy Bush @@ -925,12 +931,14 @@ Symfony is the result of the work of many people who made the code better - Péter Buri (burci) - Davide Borsatto (davide.borsatto) - kaiwa + - RJ Garcia - Charles Sanquer (csanquer) - Albert Ganiev (helios-ag) - Neil Katin - David Otton - Will Donohoe - peter + - Jaroslav Kuba - flip111 - Jérémy Jourdin (jjk801) - BRAMILLE Sébastien (oktapodia) @@ -938,6 +946,7 @@ Symfony is the result of the work of many people who made the code better - Gustavo Adrian - Yannick - spdionis + - rchoquet - Taras Girnyk - Eduardo García Sanz (coma) - James Gilliland @@ -967,6 +976,7 @@ Symfony is the result of the work of many people who made the code better - Paul Matthews - Juan Traverso - Tarjei Huse (tarjei) + - tsufeki - Philipp Strube - Christian Sciberras - Clement Herreman (clemherreman) @@ -1057,6 +1067,7 @@ Symfony is the result of the work of many people who made the code better - m.chwedziak - Philip Frank - Lance McNearney + - Gonzalo Vilaseca (gonzalovilaseca) - Giorgio Premi - Ian Carroll - caponica @@ -1067,7 +1078,6 @@ Symfony is the result of the work of many people who made the code better - adev - Luis Galeas - Martin Pärtel - - George Mponos (gmponos) - Patrick Daley (padrig) - Xavier Briand (xavierbriand) - Max Summe @@ -1148,6 +1158,7 @@ Symfony is the result of the work of many people who made the code better - Hoffmann András - Olivier - pscheit + - Wybren Koelmans - Zdeněk Drahoš - Dan Harper - moldcraft @@ -1235,6 +1246,7 @@ Symfony is the result of the work of many people who made the code better - Fabien LUCAS (flucas2) - Indra Gunawan (indragunawan) - Karim Cassam Chenaï (ka) + - Michal Kurzeja (mkurzeja) - Nicolas Bastien (nicolas_bastien) - Denis (yethee) - Andrew Zhilin (zhil) @@ -1253,9 +1265,11 @@ Symfony is the result of the work of many people who made the code better - Warwick - VJ - Chris + - Florent Olivaud - JakeFr - Simon Sargeant - efeen + - Nicolas Pion - Muhammed Akbulut - Michał Dąbrowski (defrag) - Simone Fumagalli (hpatoio) @@ -1272,6 +1286,7 @@ Symfony is the result of the work of many people who made the code better - Grinbergs Reinis (shima5) - Artem Lopata (bumz) - Nicole Cordes + - VolCh - Alexey Popkov - Gijs Kunze - Artyom Protaskin @@ -1377,6 +1392,7 @@ Symfony is the result of the work of many people who made the code better - Dane Powell - Gerrit Drost - Linnaea Von Lavia + - Javan Eskander - Lenar Lõhmus - Cristian Gonzalez - AlberT @@ -1425,7 +1441,6 @@ Symfony is the result of the work of many people who made the code better - Yanick Witschi - Ondrej Mirtes - akimsko - - Ben Scott - Youpie - srsbiz - Taylan Kasap @@ -1558,6 +1573,7 @@ Symfony is the result of the work of many people who made the code better - Dawid Nowak - Lesnykh Ilia - Karolis Daužickas + - Nicolas - Sergio Santoro - tirnanog06 - phc @@ -1691,6 +1707,7 @@ Symfony is the result of the work of many people who made the code better - Adam Elsodaney (archfizz) - Daniel Kolvik (dkvk) - Marc Lemay (flug) + - Henne Van Och (hennevo) - Jeroen De Dauw (jeroendedauw) - Maxime COLIN (maximecolin) - Muharrem Demirci (mdemirci) diff --git a/src/Symfony/Bridge/Doctrine/ManagerRegistry.php b/src/Symfony/Bridge/Doctrine/ManagerRegistry.php index d602bfc2acaad..b30fd0691b1a8 100644 --- a/src/Symfony/Bridge/Doctrine/ManagerRegistry.php +++ b/src/Symfony/Bridge/Doctrine/ManagerRegistry.php @@ -53,7 +53,10 @@ protected function resetService($name) } $manager->setProxyInitializer(\Closure::bind( function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) { - if (isset($this->aliases[$name = strtolower($name)])) { + if (isset($this->normalizedIds[$normalizedId = strtolower($name)])) { + $name = $this->normalizedIds[$normalizedId]; + } + if (isset($this->aliases[$name])) { $name = $this->aliases[$name]; } $method = !isset($this->methodMap[$name]) ? 'get'.strtr($name, $this->underscoreMap).'Service' : $this->methodMap[$name]; diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php index dff0e245f741b..38256791ff565 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php @@ -121,7 +121,9 @@ protected function execute(InputInterface $input, OutputInterface $output) continue; } - $targetDir = $bundlesDir.preg_replace('/bundle$/', '', strtolower($bundle->getName())); + $assetDir = preg_replace('/bundle$/', '', strtolower($bundle->getName())); + $targetDir = $bundlesDir.$assetDir; + $validAssetDirs[] = $assetDir; if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { $message = sprintf("%s\n-> %s", $bundle->getName(), $targetDir); @@ -153,14 +155,10 @@ protected function execute(InputInterface $input, OutputInterface $output) $exitCode = 1; $rows[] = array(sprintf('%s', '\\' === DIRECTORY_SEPARATOR ? 'ERROR' : "\xE2\x9C\x98" /* HEAVY BALLOT X (U+2718) */), $message, $e->getMessage()); } - $validAssetDirs[] = $targetDir; } // remove the assets of the bundles that no longer exist - foreach (new \FilesystemIterator($bundlesDir) as $dir) { - if (!in_array($dir, $validAssetDirs)) { - $this->filesystem->remove($dir); - } - } + $dirsToRemove = Finder::create()->depth(0)->directories()->exclude($validAssetDirs)->in($bundlesDir); + $this->filesystem->remove($dirsToRemove); $io->table(array('', 'Bundle', 'Method / Error'), $rows); diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php index e7d6d80a57ac7..f26fddabb0a93 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php @@ -137,7 +137,7 @@ private function extractCallable(Route $route) } } - $nameParser = $this->getContainer()->get('controller_name_converter'); + $nameParser = new ControllerNameParser($this->getApplication()->getKernel()); try { $shortNotation = $nameParser->build($controller); $route->setDefault('_controller', $shortNotation); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php index 3abfd9585f159..5996415e10a64 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php @@ -78,27 +78,27 @@ public function testSecurityConfigurationForMultipleIPAddresses($config) $this->assertRestricted($barredClient, '/secured-by-two-ips'); } - /** - * @dataProvider getConfigs - */ - public function testSecurityConfigurationForExpression($config) - { - $allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('HTTP_USER_AGENT' => 'Firefox 1.0')); - $this->assertAllowed($allowedClient, '/protected-via-expression'); - - $barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array()); - $this->assertRestricted($barredClient, '/protected-via-expression'); - - $allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array()); - - $allowedClient->request('GET', '/protected-via-expression'); - $form = $allowedClient->followRedirect()->selectButton('login')->form(); - $form['_username'] = 'johannes'; - $form['_password'] = 'test'; - $allowedClient->submit($form); - $this->assertRedirect($allowedClient->getResponse(), '/protected-via-expression'); - $this->assertAllowed($allowedClient, '/protected-via-expression'); - } + /** + * @dataProvider getConfigs + */ + public function testSecurityConfigurationForExpression($config) + { + $allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('HTTP_USER_AGENT' => 'Firefox 1.0')); + $this->assertAllowed($allowedClient, '/protected-via-expression'); + + $barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array()); + $this->assertRestricted($barredClient, '/protected-via-expression'); + + $allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array()); + + $allowedClient->request('GET', '/protected-via-expression'); + $form = $allowedClient->followRedirect()->selectButton('login')->form(); + $form['_username'] = 'johannes'; + $form['_password'] = 'test'; + $allowedClient->submit($form); + $this->assertRedirect($allowedClient->getResponse(), '/protected-via-expression'); + $this->assertAllowed($allowedClient, '/protected-via-expression'); + } private function assertAllowed($client, $path) { diff --git a/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php b/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php index e4fa4c97b7ba9..3ae553c705a3e 100644 --- a/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/AbstractAdapter.php @@ -14,6 +14,7 @@ use Psr\Cache\CacheItemInterface; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerInterface; +use Psr\Log\NullLogger; use Symfony\Component\Cache\CacheItem; use Symfony\Component\Cache\Exception\InvalidArgumentException; use Symfony\Component\Cache\Traits\AbstractTrait; @@ -101,7 +102,9 @@ public static function createSystemCache($namespace, $defaultLifetime, $version, } $apcu = new ApcuAdapter($namespace, (int) $defaultLifetime / 5, $version); - if (null !== $logger) { + if ('cli' === PHP_SAPI && !ini_get('apc.enable_cli')) { + $apcu->setLogger(new NullLogger()); + } elseif (null !== $logger) { $apcu->setLogger($logger); } diff --git a/src/Symfony/Component/Cache/Traits/ApcuTrait.php b/src/Symfony/Component/Cache/Traits/ApcuTrait.php index 7f1e87e2ada59..5614b390cf2f4 100644 --- a/src/Symfony/Component/Cache/Traits/ApcuTrait.php +++ b/src/Symfony/Component/Cache/Traits/ApcuTrait.php @@ -52,7 +52,7 @@ private function init($namespace, $defaultLifetime, $version) protected function doFetch(array $ids) { try { - return apcu_fetch($ids); + return apcu_fetch($ids) ?: array(); } catch (\Error $e) { throw new \ErrorException($e->getMessage(), $e->getCode(), E_ERROR, $e->getFile(), $e->getLine()); } @@ -94,7 +94,11 @@ protected function doDelete(array $ids) protected function doSave(array $values, $lifetime) { try { - return array_keys(apcu_store($values, null, $lifetime)); + if (false === $failures = apcu_store($values, null, $lifetime)) { + $failures = $values; + } + + return array_keys($failures); } catch (\Error $e) { } catch (\Exception $e) { } diff --git a/src/Symfony/Component/Debug/ErrorHandler.php b/src/Symfony/Component/Debug/ErrorHandler.php index e25b5a6dd8b2a..369ed26f125c4 100644 --- a/src/Symfony/Component/Debug/ErrorHandler.php +++ b/src/Symfony/Component/Debug/ErrorHandler.php @@ -414,7 +414,7 @@ public function handleError($type, $message, $file, $line) $errorAsException = self::$silencedErrorCache[$message]; ++$errorAsException->count; } else { - $lightTrace = $this->tracedErrors & $type ? $this->cleanTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), $type, $file, $line, false) : array(); + $lightTrace = $this->tracedErrors & $type ? $this->cleanTrace(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3), $type, $file, $line, false) : array(); $errorAsException = new SilencedErrorContext($type, $file, $line, $lightTrace); } diff --git a/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php index f45f99718d318..92fd0da71e648 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php @@ -120,6 +120,7 @@ private function getContainerDeprecationLogs() $log['priorityName'] = 'DEBUG'; $log['channel'] = '-'; $log['scream'] = false; + unset($log['type'], $log['file'], $log['line'], $log['trace'], $log['trace'], $log['count']); $logs[] = $log; } @@ -251,7 +252,7 @@ private function computeErrorsCount(array $containerDeprecationLogs) } foreach ($containerDeprecationLogs as $deprecationLog) { - $count['deprecation_count'] += $deprecationLog['count']; + $count['deprecation_count'] += $deprecationLog['context']['exception']->count; } ksort($count['priorities']); diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 955be15e9ea12..0fc96a0acc71f 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -61,11 +61,11 @@ abstract class Kernel implements KernelInterface, TerminableInterface private $projectDir; - const VERSION = '3.3.3'; - const VERSION_ID = 30303; + const VERSION = '3.3.4'; + const VERSION_ID = 30304; const MAJOR_VERSION = 3; const MINOR_VERSION = 3; - const RELEASE_VERSION = 3; + const RELEASE_VERSION = 4; const EXTRA_VERSION = ''; const END_OF_MAINTENANCE = '01/2018'; @@ -551,7 +551,7 @@ protected function initializeContainer() return; } - $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 3); // Clean the trace by removing first frames added by the error handler itself. for ($i = 0; isset($backtrace[$i]); ++$i) { if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) { diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php index 9a306e533e006..e642e3c33715f 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/DumpDataCollectorTest.php @@ -50,7 +50,7 @@ public function testDump() ); $this->assertEquals($xDump, $dump); - $this->assertStringMatchesFormat('a:3:{i:0;a:5:{s:4:"data";O:39:"Symfony\Component\VarDumper\Cloner\Data":%a', $collector->serialize()); + $this->assertStringMatchesFormat('a:3:{i:0;a:5:{s:4:"data";%c:39:"Symfony\Component\VarDumper\Cloner\Data":%a', $collector->serialize()); $this->assertSame(0, $collector->getDumpsCount()); $this->assertSame('a:2:{i:0;b:0;i:1;s:5:"UTF-8";}', $collector->serialize()); } diff --git a/src/Symfony/Component/VarDumper/Cloner/Data.php b/src/Symfony/Component/VarDumper/Cloner/Data.php index 5a6997cf251cb..655fae0ca6fe5 100644 --- a/src/Symfony/Component/VarDumper/Cloner/Data.php +++ b/src/Symfony/Component/VarDumper/Cloner/Data.php @@ -16,7 +16,7 @@ /** * @author Nicolas Grekas */ -class Data implements \ArrayAccess, \Countable, \IteratorAggregate +class Data implements \ArrayAccess, \Countable, \IteratorAggregate, \Serializable { private $data; private $position = 0; @@ -278,6 +278,57 @@ public function dump(DumperInterface $dumper) $this->dumpItem($dumper, new Cursor(), $refs, $this->data[$this->position][$this->key]); } + /** + * @internal + */ + public function serialize() + { + $data = $this->data; + + foreach ($data as $i => $values) { + foreach ($values as $k => $v) { + if ($v instanceof Stub) { + if (Stub::TYPE_ARRAY === $v->type) { + $v = self::mapStubConsts($v, false); + $data[$i][$k] = array($v->class, $v->position, $v->cut); + } else { + $v = self::mapStubConsts($v, false); + $data[$i][$k] = array($v->class, $v->position, $v->cut, $v->type, $v->value, $v->handle, $v->refCount, $v->attr); + } + } + } + } + + return serialize(array($data, $this->position, $this->key, $this->maxDepth, $this->maxItemsPerDepth, $this->useRefHandles)); + } + + /** + * @internal + */ + public function unserialize($serialized) + { + list($data, $this->position, $this->key, $this->maxDepth, $this->maxItemsPerDepth, $this->useRefHandles) = unserialize($serialized); + + foreach ($data as $i => $values) { + foreach ($values as $k => $v) { + if ($v && is_array($v)) { + $s = new Stub(); + if (3 === count($v)) { + $s->type = Stub::TYPE_ARRAY; + $s = self::mapStubConsts($s, false); + list($s->class, $s->position, $s->cut) = $v; + $s->value = $s->cut + count($data[$s->position]); + } else { + list($s->class, $s->position, $s->cut, $s->type, $s->value, $s->handle, $s->refCount, $s->attr) = $v; + } + $data[$i][$k] = self::mapStubConsts($s, true); + } + } + } + + $this->data = $data; + } + /** * Depth-first dumping of items. * @@ -406,4 +457,23 @@ private function dumpChildren($dumper, $parentCursor, &$refs, $children, $hashCu return $hashCut; } + + private static function mapStubConsts(Stub $stub, $resolve) + { + static $stubConstIndexes, $stubConstValues; + + if (null === $stubConstIndexes) { + $r = new \ReflectionClass(Stub::class); + $stubConstIndexes = array_flip(array_values($r->getConstants())); + $stubConstValues = array_flip($stubConstIndexes); + } + + $map = $resolve ? $stubConstValues : $stubConstIndexes; + + $stub = clone $stub; + $stub->type = $map[$stub->type]; + $stub->class = isset($map[$stub->class]) ? $map[$stub->class] : $stub->class; + + return $stub; + } }