Example #1
0
 protected function _echoExceptionBacktrace(Exception $e)
 {
     $params = '';
     if ($e instanceof lmbException) {
         $error = htmlspecialchars($e->getOriginalMessage());
         foreach ($e->getParams() as $name => $value) {
             $params .= $name . '  =>  ' . print_r($value, true) . PHP_EOL;
         }
         $params = htmlspecialchars($params);
     } else {
         $error = htmlspecialchars($e->getMessage());
     }
     if ($e instanceof lmbException) {
         $trace = htmlspecialchars($e->getNiceTraceAsString());
     } else {
         $trace = htmlspecialchars($e->getTraceAsString());
     }
     list($file, $line) = $this->_extractExceptionFileAndLine($e);
     $context = htmlspecialchars($this->_getFileContext($file, $line));
     $request = htmlspecialchars($this->toolkit->getRequest()->dump());
     $session = htmlspecialchars($this->toolkit->getSession()->dump());
     for ($i = 0; $i < ob_get_level(); $i++) {
         ob_end_clean();
     }
     echo $this->_renderTemplate($error, $params, $trace, $file, $line, $context, $request, $session);
 }