diff --git a/library/think/App.php b/library/think/App.php index 99613ac6..9865d1d3 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -349,6 +349,12 @@ class App self::$debug = Config::get('app_debug'); if (!self::$debug) { ini_set('display_errors', 'Off'); + } else { + //重新申请一块比较大的buffer + if (ob_get_level() > 0) { + ob_end_clean(); + } + ob_start(); } // 应用命名空间 diff --git a/library/think/exception/Handle.php b/library/think/exception/Handle.php index 7efe241c..a598df8c 100644 --- a/library/think/exception/Handle.php +++ b/library/think/exception/Handle.php @@ -155,8 +155,10 @@ class Handle while (ob_get_level() > 1) { ob_end_clean(); } + + $data['echo'] = ob_get_clean(); + ob_start(); - ob_implicit_flush(0); extract($data); include Config::get('exception_tmpl'); // 获取并清空缓存 diff --git a/tpl/think_exception.tpl b/tpl/think_exception.tpl index 5fadd7cc..aabf82a8 100644 --- a/tpl/think_exception.tpl +++ b/tpl/think_exception.tpl @@ -123,6 +123,26 @@ .line-error{ 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 .message{ @@ -130,7 +150,7 @@ border: 1px solid #ddd; border-bottom: 0 none; line-height: 18px; - font-size:16px; + font-size:16px; border-top-left-radius: 4px; border-top-right-radius: 4px; font-family: Consolas,"Liberation Mono",Courier,Verdana,"微软雅黑"; @@ -258,6 +278,9 @@ +
+ +