From 51b6e9eb96ec6bce0557c268d71e143550171287 Mon Sep 17 00:00:00 2001 From: Samuel ROZE Date: Fri, 17 Aug 2018 14:07:19 +0200 Subject: [PATCH 1/3] Make the `message_bus` alias public --- .../FrameworkBundle/DependencyInjection/FrameworkExtension.php | 2 +- .../Tests/DependencyInjection/FrameworkExtensionTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index b08f1bbde2..19f62d8dc7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -1488,7 +1488,7 @@ class FrameworkExtension extends Extension $container->register($busId, MessageBus::class)->addArgument(array())->addTag('messenger.bus'); if ($busId === $config['default_bus']) { - $container->setAlias('message_bus', $busId); + $container->setAlias('message_bus', $busId)->setPublic(true); $container->setAlias(MessageBusInterface::class, $busId); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index 47a496ad24..b3dc2cc163 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -528,6 +528,7 @@ abstract class FrameworkExtensionTest extends TestCase { $container = $this->createContainerFromFile('messenger'); $this->assertTrue($container->hasAlias('message_bus')); + $this->assertTrue($container->getAlias('message_bus')->isPublic()); $this->assertFalse($container->hasDefinition('messenger.transport.amqp.factory')); $this->assertTrue($container->hasDefinition('messenger.transport_factory')); $this->assertSame(TransportFactory::class, $container->getDefinition('messenger.transport_factory')->getClass()); From 2ebc75b9a18551b0eb5f2ae5bfd27c8d25094150 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 18 Aug 2018 22:38:48 +0200 Subject: [PATCH 2/3] [Security\Http] Restore laziness of listener iterator --- .../Component/Security/Http/Firewall.php | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/src/Symfony/Component/Security/Http/Firewall.php b/src/Symfony/Component/Security/Http/Firewall.php index b9d83b49cd..a0a2aa8411 100644 --- a/src/Symfony/Component/Security/Http/Firewall.php +++ b/src/Symfony/Component/Security/Http/Firewall.php @@ -50,31 +50,38 @@ class Firewall implements EventSubscriberInterface // register listeners for this firewall $listeners = $this->map->getListeners($event->getRequest()); - $accessListener = null; - $authenticationListeners = array(); + $authenticationListeners = $listeners[0]; + $exceptionListener = $listeners[1]; + $logoutListener = isset($listeners[2]) ? $listeners[2] : null; - foreach ($listeners[0] as $listener) { - if ($listener instanceof AccessListener) { - $accessListener = $listener; - } else { - $authenticationListeners[] = $listener; - } - } - - if (null !== $exceptionListener = $listeners[1]) { + if (null !== $exceptionListener) { $this->exceptionListeners[$event->getRequest()] = $exceptionListener; $exceptionListener->register($this->dispatcher); } - if (null !== $logoutListener = isset($listeners[2]) ? $listeners[2] : null) { - $authenticationListeners[] = $logoutListener; - } + $authenticationListeners = function () use ($authenticationListeners, $logoutListener) { + $accessListener = null; - if (null !== $accessListener) { - $authenticationListeners[] = $accessListener; - } + foreach ($authenticationListeners as $listener) { + if ($listener instanceof AccessListener) { + $accessListener = $listener; - $this->handleRequest($event, $authenticationListeners); + continue; + } + + yield $listener; + } + + if (null !== $logoutListener) { + yield $logoutListener; + } + + if (null !== $accessListener) { + yield $accessListener; + } + }; + + $this->handleRequest($event, $authenticationListeners()); } public function onKernelFinishRequest(FinishRequestEvent $event) From 02e3ec0539b2ec5a870eeb428cd5b3d12f8cd8b3 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 19 Aug 2018 10:02:31 +0200 Subject: [PATCH 3/3] [travis] fix composer.lock invalidation for deps=low --- .github/rm-invalid-lowest-lock-files.php | 62 ++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/.github/rm-invalid-lowest-lock-files.php b/.github/rm-invalid-lowest-lock-files.php index 5515238d9a..81f58ccdd4 100644 --- a/.github/rm-invalid-lowest-lock-files.php +++ b/.github/rm-invalid-lowest-lock-files.php @@ -1,5 +1,11 @@ $dirsByCommit) { + $chs[] = $ch = array(curl_init(), fopen($_SERVER['HOME'].'/.cache/composer/repo/https---repo.packagist.org/provider-'.strtr($name, '/', '$').'.json', 'wb')); + curl_setopt($ch[0], CURLOPT_URL, 'https://repo.packagist.org/p/'.$name.'.json'); + curl_setopt($ch[0], CURLOPT_FILE, $ch[1]); + curl_setopt($ch[0], CURLOPT_SHARE, $sh); + curl_multi_add_handle($mh, $ch[0]); +} + +do { + curl_multi_exec($mh, $active); + curl_multi_select($mh); +} while ($active); + +foreach ($chs as list($ch, $fd)) { + curl_multi_remove_handle($mh, $ch); + curl_close($ch); + fclose($fd); +} + +foreach ($referencedCommits as $name => $dirsByCommit) { + $repo = file_get_contents($_SERVER['HOME'].'/.cache/composer/repo/https---repo.packagist.org/provider-'.strtr($name, '/', '$').'.json'); + $repo = json_decode($repo, true); + + foreach ($repo['packages'][$name] as $version) { + unset($referencedCommits[$name][$version['source']['reference']]); + } +} + +foreach ($referencedCommits as $name => $dirsByCommit) { + foreach ($dirsByCommit as $dirs) { + foreach ($dirs as $dir) { + echo "$dir/composer.lock references old commit for $name.\n"; + @unlink($dir.'/composer.lock'); + } } }