import ContainerAwareCommand from SymfonyFramework bundle

This commit is contained in:
Manuel Raynaud
2013-06-03 15:28:04 +02:00
parent adea29bd5c
commit e7c06c2158

View File

@@ -23,7 +23,6 @@
namespace Thelia\Command; namespace Thelia\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputOption;
@@ -31,7 +30,9 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOException; use Symfony\Component\Filesystem\Exception\IOException;
class CacheClear extends Command use Thelia\Command\ContainerAwareCommand;
class CacheClear extends ContainerAwareCommand
{ {
protected function configure() protected function configure()
{ {
@@ -43,7 +44,7 @@ class CacheClear extends Command
protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output)
{ {
$cacheDir = $this->getApplication()->getContainer()->getParameter("kernel.cache_dir"); $cacheDir = $this->getContainer()->getParameter("kernel.cache_dir");
if (!is_writable($cacheDir)) { if (!is_writable($cacheDir)) {
throw new \RuntimeException(sprintf('Unable to write in the "%s" directory', $cacheDir)); throw new \RuntimeException(sprintf('Unable to write in the "%s" directory', $cacheDir));