From 52a22ca852abcd4ac9e375986c68f1548e4a5dee Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 31 Mar 2014 09:42:08 +0200 Subject: [PATCH] put clear image cache as an option of cache:clear command --- core/lib/Thelia/Command/CacheClear.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/lib/Thelia/Command/CacheClear.php b/core/lib/Thelia/Command/CacheClear.php index 4795cc68a..400789ef7 100644 --- a/core/lib/Thelia/Command/CacheClear.php +++ b/core/lib/Thelia/Command/CacheClear.php @@ -53,6 +53,12 @@ class CacheClear extends ContainerAwareCommand InputOption::VALUE_NONE, "do not clear the assets cache in the web space" ) + ->addOption( + 'with-images', + null, + InputOption::VALUE_NONE, + 'clear images generated in web/cache directory' + ) ; } @@ -62,11 +68,15 @@ class CacheClear extends ContainerAwareCommand $cacheDir = $this->getContainer()->getParameter("kernel.cache_dir"); $this->clearCache($cacheDir, $output); - $this->clearCache(THELIA_WEB_DIR . "cache", $output); + if (!$input->getOption("without-assets")) { $this->clearCache(THELIA_WEB_DIR . "assets", $output); } + if ($input->getOption('with-images')) { + $this->clearCache(THELIA_WEB_DIR . "cache", $output); + } + } protected function clearCache($dir, OutputInterface $output)