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); }
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); }
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; }
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); }