clear cache after each activatin or deactivation

This commit is contained in:
Manuel Raynaud
2013-10-18 08:33:46 +02:00
parent 2ecd1caac6
commit 3a4fb6f2d2

View File

@@ -23,6 +23,7 @@
namespace Thelia\Action;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Thelia\Core\Event\Cache\CacheEvent;
use Thelia\Core\Event\Module\ModuleToggleActivationEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Model\ModuleQuery;
@@ -56,9 +57,18 @@ class Module extends BaseAction implements EventSubscriberInterface
if($module->isModified()) {
$event->setModule($module);
}
$this->cacheClear();
}
}
protected function cacheClear()
{
$cacheEvent = new CacheEvent($this->container->getParameter('kernel.cache_dir'));
$this->getDispatcher()->dispatch(TheliaEvents::CACHE_CLEAR, $cacheEvent);
}
/**
* Returns an array of event names this subscriber wants to listen to.
*