예제 #1
0
 /**
  * Init
  */
 public function init(ModuleManagerInterface $moduleManager)
 {
     // get service manager
     $this->serviceLocator = $moduleManager->getEvent()->getParam('ServiceManager');
     $moduleManager->getEventManager()->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, [$this, 'initApplication']);
     $eventManager = AclEvent::getEventManager();
     $eventManager->attach(AclEvent::DELETE_ROLE, function ($e) use($moduleManager) {
         $userModel = $moduleManager->getEvent()->getParam('ServiceManager')->get('Application\\Model\\ModelManager')->getInstance('User\\Model\\UserBase');
         // change the empty role with the default role
         $userModel->updateUsersWithEmptyRoles(AclBaseModel::DEFAULT_ROLE_MEMBER);
     }, -100);
 }
예제 #2
0
파일: Module.php 프로젝트: esase/dream-cms
 /**
  * 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();
     });
 }