From 340bb3a66070409b200453aab2d3dd0789879d80 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 15 Jun 2016 16:54:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BError=E7=B1=BB=E7=9A=84regist?= =?UTF-8?q?er=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/App.php | 5 ++++- library/think/Error.php | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/library/think/App.php b/library/think/App.php index 626b0845..3b266680 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -304,7 +304,10 @@ class App // 是否调试模式 self::$debug = Config::get('app_debug'); - + if (!self::$debug) { + ini_set('display_errors', 'Off'); + } + // 注册根命名空间 if (!empty($config['root_namespace'])) { Loader::addNamespace($config['root_namespace']); diff --git a/library/think/Error.php b/library/think/Error.php index 22334bb3..48d88ca6 100644 --- a/library/think/Error.php +++ b/library/think/Error.php @@ -29,10 +29,6 @@ class Error set_error_handler([__CLASS__, 'appError']); set_exception_handler([__CLASS__, 'appException']); register_shutdown_function([__CLASS__, 'appShutdown']); - - if (!App::$debug) { - ini_set('display_errors', 'Off'); - } } /**