コード例 #1
0
ファイル: EventErrorHandler.php プロジェクト: splot/framework
 /**
  * Handle the error by triggering Splot\Framework\Events\ExceptionDidOccur event.
  */
 public function handle()
 {
     $event = new ExceptionDidOccur($this->getException());
     // trigger the event
     $this->eventManager->trigger($event);
     // only send the response in actual web mode
     $mode = $this->container->getParameter('mode');
     if ($mode == Framework::MODE_WEB && $event->isHandled() && ($response = $event->getResponse())) {
         $response->send();
     }
     if ($event->isDefaultPrevented()) {
         return Handler::QUIT;
     }
     if ($event->isPropagationStopped()) {
         return Handler::LAST_HANDLER;
     }
     return Handler::DONE;
 }
コード例 #2
0
ファイル: AbstractModule.php プロジェクト: splot/framework
 /**
  * Returns the module's config.
  * 
  * @return Config
  */
 public function getConfig()
 {
     return $this->container->get('config.' . $this->getName());
 }
コード例 #3
0
 /**
  * Returns information whether or not application is ran in debug mode.
  * 
  * @return boolean
  */
 public function isDebug()
 {
     return $this->container->getParameter('debug');
 }