Пример #1
0
 /**
  * Execute handler from result
  *
  * @return bool
  * @access protected
  */
 protected function executeHandler()
 {
     // search handler
     $handler = $this->result->getHandler();
     if (is_null($handler)) {
         // matched, but no handler found
         return $this->defaultHandler();
     } else {
         $callable = $this->resolver->resolve($handler);
         // extension ?
         if (($route = $this->result->getRoute()) && $route->hasExtension()) {
             if ($route->runExtensions(Route::BEFORE_ROUTE, $this->result)) {
                 $callable($this->result);
                 $route->runExtensions(Route::AFTER_ROUTE, $this->result);
             }
         } else {
             $callable($this->result);
         }
         return true;
     }
 }
Пример #2
0
 /**
  * Set collector level handler if result has no handler set yet
  *
  * @param  ResultInterface $result desc
  * @return self
  * @access protected
  */
 protected function setCollectorHandler(ResultInterface $result)
 {
     $status = $result->getStatus();
     if (is_null($result->getHandler()) && $this->getHandler($status)) {
         // debug message
         $this->debug(Message::get(Message::DEBUG_SET_C_HANDLER, get_class($this), $status));
         $result->setHandler($this->getHandler($status));
     }
     return $this;
 }