Inital commit
This commit is contained in:
@@ -32,8 +32,6 @@ class ClearImageCache extends ContainerAwareCommand
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$dispatcher = $this->getContainer()->get('event_dispatcher');
|
||||
|
||||
$request = new Request();
|
||||
|
||||
try {
|
||||
@@ -41,13 +39,15 @@ class ClearImageCache extends ContainerAwareCommand
|
||||
|
||||
$subdir = $input->getArgument('subdir');
|
||||
|
||||
if (! is_null($subdir)) $event->setCacheSubdirectory($subdir);
|
||||
if (! is_null($subdir)) {
|
||||
$event->setCacheSubdirectory($subdir);
|
||||
}
|
||||
|
||||
$dispatcher->dispatch(TheliaEvents::IMAGE_CLEAR_CACHE, $event);
|
||||
$this->getDispatcher()->dispatch(TheliaEvents::IMAGE_CLEAR_CACHE, $event);
|
||||
|
||||
$output->writeln(sprintf('%s image cache successfully cleared.', is_null($subdir) ? 'Entire' : ucfirst($subdir)));
|
||||
} catch (\Exception $ex) {
|
||||
$output->writeln(sprintf("Failed to clear image cache: %s", $ex->getMessage()));
|
||||
$output->writeln(sprintf("Failed to clear image cache: %s", $ex->getMessage()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user