From a96139273f39bf2893e3501d287a1a0007cd7aeb Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 15 Nov 2017 00:32:17 +0200 Subject: [PATCH] [FrameworkBundle] Empty event dispatcher earlier in CacheClearCommand --- .../Bundle/FrameworkBundle/Command/CacheClearCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php index 4080d2a3d2..861bf21962 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php @@ -111,6 +111,9 @@ EOF $io->comment(sprintf('Clearing the cache for the %s environment with debug %s', $kernel->getEnvironment(), var_export($kernel->isDebug(), true))); $this->cacheClearer->clear($realCacheDir); + // The current event dispatcher is stale, let's not use it anymore + $this->getApplication()->setDispatcher(new EventDispatcher()); + if ($input->getOption('no-warmup')) { $this->filesystem->rename($realCacheDir, $oldCacheDir); } else { @@ -129,9 +132,6 @@ EOF $this->filesystem->remove($oldCacheDir); - // The current event dispatcher is stale, let's not use it anymore - $this->getApplication()->setDispatcher(new EventDispatcher()); - if ($output->isVerbose()) { $io->comment('Finished'); }