src/Trace.php
public static function catchError()
    {
        $e = error_get_last();
        if ($e) {

            $debugContent = self::getFileContent($e['file'], $e['line']);

            if (config('debug')) {
                return include FARM_PATH . DS . 'trace' . DS . 'error.html';
            } else {
                //FATAL ERROR 发送到邮箱
                if (config('send_debug_mail')) {
                    $title   = $_SERVER['HTTP_HOST'] . ' 有一个致命错误 ip:' . getIP() . ' ' . $_SERVER['SERVER_PROTOCOL'];
                    $content = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . PHP_EOL . 'FATAL ERROR : ' . $e['message'] . ' from ' . $e['file'] . ' on line ' . $e['line'];
                    dao('Mail')->send(config('send_mail'), $title, $content);
                }

                header("http/1.1 404 not found");
                header("status: 404 not found");
                return include FARM_PATH . DS . 'trace' . DS . '404.html';
            }
        }
    }
public static function catchError()
    {
        $e = error_get_last();
        if ($e) {

            $debugContent = self::getFileContent($e['file'], $e['line']);

            if (config('debug')) {
                return include FARM_PATH . DS . 'trace' . DS . 'error.html';
            } else {
                //FATAL ERROR 发送到邮箱
                if (config('send_debug_mail')) {
                    $title   = $_SERVER['HTTP_HOST'] . ' 有一个致命错误 ip:' . getIP() . ' ' . $_SERVER['SERVER_PROTOCOL'];
                    $content = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . PHP_EOL . 'FATAL ERROR : ' . $e['message'] . ' from ' . $e['file'] . ' on line ' . $e['line'];
                    dao('Mail')->send(config('send_mail'), $title, $content);
                }

                header("http/1.1 404 not found");
                header("status: 404 not found");
                return include FARM_PATH . DS . 'trace' . DS . '404.html';
            }
        }
    }
捕获致命错误信息 并显示