put clear image cache as an option of cache:clear command

This commit is contained in:
Manuel Raynaud
2014-03-31 09:42:08 +02:00
parent 31e962c99d
commit 52a22ca852

View File

@@ -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)