import ContainerAwareCommand from SymfonyFramework bundle
This commit is contained in:
@@ -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));
|
||||||
|
|||||||
Reference in New Issue
Block a user