Esempio n. 1
0
 public function handleException($app, $exception)
 {
     $aError = array('type' => get_class($exception), 'code' => $exception->getCode(), 'message' => $exception->getMessage(), 'file' => $exception->getFile(), 'line' => $exception->getLine());
     if (Gongo_App::cfg()->Debug->use_debug_trace(false)) {
         $aError['trace'] = $this->getTrace($exception);
     }
     Gongo_App::cfg()->Debug->use_debug_mail(false) and $app->log($aError, Gongo_App::cfg()->Debug->email);
     Gongo_App::cfg()->Debug->use_debug_log(false) and $app->log($aError);
     return $this->error($app, $aError, $app->env()->development);
 }
Esempio n. 2
0
 public function handleError($app, $errno, $message, $file, $line)
 {
     $aError = compact('errno', 'message', 'file', 'line');
     if (Gongo_App::cfg()->Debug->use_debug_trace(false)) {
         $aError['trace'] = $this->getTrace();
     }
     Gongo_App::cfg()->Debug->use_debug_mail(false) and $app->log($aError, Gongo_App::cfg()->Debug->email);
     Gongo_App::cfg()->Debug->use_debug_log(false) and $app->log($aError);
     return $this->error($app, $aError, $app->env()->development);
 }
Esempio n. 3
0
 public function render($app, $err, $fnCallback = false)
 {
     $header = isset($this->httpError[$err]) ? $this->httpError[$err] : "HTTP/1.0 {$err}";
     header($header);
     $output = $fnCallback ? Gongo_Fn::call($fnCallback) : null;
     if (is_null($output) && Gongo_App::cfg()) {
         $layout = Gongo_App::cfg()->Error->layout;
         $context = array();
         if ($layout) {
             $context['layout'] = $layout;
         }
         echo $app->render($err, $context, $app->errorTemplate);
     } else {
         $output = $output ? $output : $header;
         echo $output;
     }
     die;
 }
Esempio n. 4
0
File: App.php Progetto: no22/gongo
 public function render($viewName, $context = array(), $template = null)
 {
     $context = array_merge($this->context->_(), $context);
     $context['app'] = $this;
     $context['viewName'] = $viewName;
     $context['mountPoint'] = $this->url->options->mountPoint;
     $context['error'] = $this->error;
     $context['success'] = $this->success;
     if (!isset($context['layout'])) {
         $context['layout'] = Gongo_App::cfg()->Template->layout;
     }
     if (is_null($template)) {
         return $this->template->render($context, $viewName);
     }
     return $template->render($context, $viewName);
 }