put clear image cache as an option of cache:clear command
This commit is contained in:
@@ -53,6 +53,12 @@ class CacheClear extends ContainerAwareCommand
|
|||||||
InputOption::VALUE_NONE,
|
InputOption::VALUE_NONE,
|
||||||
"do not clear the assets cache in the web space"
|
"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");
|
$cacheDir = $this->getContainer()->getParameter("kernel.cache_dir");
|
||||||
|
|
||||||
$this->clearCache($cacheDir, $output);
|
$this->clearCache($cacheDir, $output);
|
||||||
$this->clearCache(THELIA_WEB_DIR . "cache", $output);
|
|
||||||
if (!$input->getOption("without-assets")) {
|
if (!$input->getOption("without-assets")) {
|
||||||
$this->clearCache(THELIA_WEB_DIR . "assets", $output);
|
$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)
|
protected function clearCache($dir, OutputInterface $output)
|
||||||
|
|||||||
Reference in New Issue
Block a user