clear cache after each activatin or deactivation
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
namespace Thelia\Action;
|
namespace Thelia\Action;
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
|
use Thelia\Core\Event\Cache\CacheEvent;
|
||||||
use Thelia\Core\Event\Module\ModuleToggleActivationEvent;
|
use Thelia\Core\Event\Module\ModuleToggleActivationEvent;
|
||||||
use Thelia\Core\Event\TheliaEvents;
|
use Thelia\Core\Event\TheliaEvents;
|
||||||
use Thelia\Model\ModuleQuery;
|
use Thelia\Model\ModuleQuery;
|
||||||
@@ -56,9 +57,18 @@ class Module extends BaseAction implements EventSubscriberInterface
|
|||||||
if($module->isModified()) {
|
if($module->isModified()) {
|
||||||
$event->setModule($module);
|
$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.
|
* Returns an array of event names this subscriber wants to listen to.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user