From 3c4d168ca9967f5526ec71cc9b1db2716a9bd76a Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 21 Nov 2017 11:54:42 +0100 Subject: [PATCH] [FrameworkBundle] Ignore failures when removing the old cache dir --- .../Bundle/FrameworkBundle/Command/CacheClearCommand.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php index 861bf21962..f252014e26 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php @@ -16,6 +16,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\EventDispatcher\EventDispatcher; +use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface; use Symfony\Component\HttpKernel\KernelInterface; @@ -130,7 +131,11 @@ EOF $io->comment('Removing old cache directory...'); } - $this->filesystem->remove($oldCacheDir); + try { + $this->filesystem->remove($oldCacheDir); + } catch (IOException $e) { + $io->warning($e->getMessage()); + } if ($output->isVerbose()) { $io->comment('Finished');