From 3a4fb6f2d240a1a96909dee8a7d08a763359b500 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 18 Oct 2013 08:33:46 +0200 Subject: [PATCH] clear cache after each activatin or deactivation --- core/lib/Thelia/Action/Module.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/lib/Thelia/Action/Module.php b/core/lib/Thelia/Action/Module.php index 18fdb85cb..5025c513f 100644 --- a/core/lib/Thelia/Action/Module.php +++ b/core/lib/Thelia/Action/Module.php @@ -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. *