Ejemplo n.º 1
0
 public function bootstrap(ModuleManager $moduleManager, ApplicationInterface $app)
 {
     $this->application = $app;
     $locator = $app->getServiceManager();
     if ($this->getOption('enable_guards.route', true)) {
         $routeProtector = $locator->get('ZfcAcl\\Guard\\Route');
         $app->events()->attach('route', array($routeProtector, 'onRoute'), -1000);
     }
     if ($this->getOption('enable_guards.event', true)) {
         $guard = $locator->get('ZfcAcl\\Guard\\Event');
         $guard->bootstrap();
     }
     if ($this->getOption('enable_guards.dispatch', true)) {
         $guard = $locator->get('ZfcAcl\\Guard\\Dispatch');
         $app->events()->attach('dispatch', array($guard, 'dispatch'), 1000);
     }
 }
Ejemplo n.º 2
0
 /**
  * Trigger the "bootstrap" event
  *
  * Triggers with the keys "application" and "config", the latter pointing
  * to the Module ManagerInterface attached to the bootstrap.
  *
  * @param  ApplicationInterface $application
  * @return void
  */
 protected function setupEvents(ApplicationInterface $application)
 {
     $application->events()->setSharedManager($this->events()->getSharedManager());
     $params = array('application' => $application, 'config' => $this->config);
     $this->events()->trigger(MvcEvent::EVENT_BOOTSTRAP, $this, $params);
 }