Пример #1
0
 public static function shutdown()
 {
     if (is_null($error = error_get_last()) === false) {
         self::handler($error['type'], $error['message'], $error['file'], $error['line']);
     }
     global $cfg;
     if (count(self::$errors) > 0) {
         /*if(
             !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && 
             strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
           */
         if (defined('KDB_JSON')) {
             Header('Content-type: application/json');
             http_response_code(400);
             $return = ['status' => 400, 'result' => 'Internal', 'errors' => self::$errors];
             echo json_encode($return, JSON_PRETTY_PRINT);
         } else {
             self::$html = Pug::c('Debug', ['errors' => self::$errors], true);
             if (self::$html == false) {
                 hpr(self::$errors);
             } else {
                 echo self::$html;
             }
         }
     }
 }
Пример #2
0
 public function index()
 {
     hpr('404 page placeholder');
 }