/** * Init * * @param \Zend\ModuleManager\ModuleManagerInterface $moduleManager * @return void */ public function init(ModuleManagerInterface $moduleManager) { // get service manager $this->serviceLocator = $moduleManager->getEvent()->getParam('ServiceManager'); // clear cache $eventManager = AclEvent::getEventManager(); $eventManager->attach(AclEvent::DELETE_ROLE, function () { PageCacheUtility::clearPageCache(); }); // clear cache $eventManager = LocalizationEvent::getEventManager(); $eventManager->attach(LocalizationEvent::UNINSTALL, function () { PageCacheUtility::clearPageCache(); }); }
/** * Init application * * @param \Zend\ModuleManager\ModuleEvent $e */ public function initApplication(ModuleEvent $e) { // init user identity $this->initUserIdentity(); // init time zone $this->initTimeZone(); // clear users caches $eventManager = LayoutEvent::getEventManager(); $eventManager->attach(LayoutEvent::UNINSTALL, function ($e) { UserCacheUtility::clearUserCache(); }); $eventManager = LocalizationEvent::getEventManager(); $eventManager->attach(LocalizationEvent::UNINSTALL, function ($e) { UserCacheUtility::clearUserCache(); }); }
/** * Init application * * @return void */ public function initApplication() { // init php settings $this->initPhpSettings(); // init a strict sql mode $this->initSqlStrictMode(); // set the service manager ServiceLocatorService::setServiceLocator($this->serviceLocator); $request = $this->serviceLocator->get('Request'); if (!$request instanceof ConsoleRequest) { // init session $this->initSession(); } $eventManager = LocalizationEvent::getEventManager(); $eventManager->attach(LocalizationEvent::UNINSTALL, function () { ApplicationCacheUtility::clearSettingCache(); }); }