mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-06 23:02:48 +08:00
改进异常页面
This commit is contained in:
@@ -349,6 +349,12 @@ class App
|
|||||||
self::$debug = Config::get('app_debug');
|
self::$debug = Config::get('app_debug');
|
||||||
if (!self::$debug) {
|
if (!self::$debug) {
|
||||||
ini_set('display_errors', 'Off');
|
ini_set('display_errors', 'Off');
|
||||||
|
} else {
|
||||||
|
//重新申请一块比较大的buffer
|
||||||
|
if (ob_get_level() > 0) {
|
||||||
|
ob_end_clean();
|
||||||
|
}
|
||||||
|
ob_start();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 应用命名空间
|
// 应用命名空间
|
||||||
|
|||||||
@@ -155,8 +155,10 @@ class Handle
|
|||||||
while (ob_get_level() > 1) {
|
while (ob_get_level() > 1) {
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data['echo'] = ob_get_clean();
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
ob_implicit_flush(0);
|
|
||||||
extract($data);
|
extract($data);
|
||||||
include Config::get('exception_tmpl');
|
include Config::get('exception_tmpl');
|
||||||
// 获取并清空缓存
|
// 获取并清空缓存
|
||||||
|
|||||||
@@ -123,6 +123,26 @@
|
|||||||
.line-error{
|
.line-error{
|
||||||
background: #f8cbcb;
|
background: #f8cbcb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.echo table {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.echo pre {
|
||||||
|
padding: 16px;
|
||||||
|
overflow: auto;
|
||||||
|
font-size: 85%;
|
||||||
|
line-height: 1.45;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 3px;
|
||||||
|
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
.echo pre > pre {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Exception Info */
|
/* Exception Info */
|
||||||
.exception .message{
|
.exception .message{
|
||||||
@@ -130,7 +150,7 @@
|
|||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
border-bottom: 0 none;
|
border-bottom: 0 none;
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
font-size:16px;
|
font-size:16px;
|
||||||
border-top-left-radius: 4px;
|
border-top-left-radius: 4px;
|
||||||
border-top-right-radius: 4px;
|
border-top-right-radius: 4px;
|
||||||
font-family: Consolas,"Liberation Mono",Courier,Verdana,"微软雅黑";
|
font-family: Consolas,"Liberation Mono",Courier,Verdana,"微软雅黑";
|
||||||
@@ -258,6 +278,9 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div class="echo">
|
||||||
|
<?php echo $echo;?>
|
||||||
|
</div>
|
||||||
<?php if(\think\App::$debug) { ?>
|
<?php if(\think\App::$debug) { ?>
|
||||||
<div class="exception">
|
<div class="exception">
|
||||||
<div class="message">
|
<div class="message">
|
||||||
|
|||||||
Reference in New Issue
Block a user