From 59f71a86bbb88635dbe3f25e158736ee0240b444 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 2 Dec 2015 16:45:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AD=E5=8C=85=E8=B7=AF=E7=94=B1=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=9A=84=E6=97=B6=E5=80=99=20=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=80=BC=20=E5=A6=82=E6=9E=9C=E6=98=AF?= =?UTF-8?q?=E6=95=B0=E7=BB=84=E4=B9=8B=E5=A4=96=E7=9A=84=20=E9=83=BD?= =?UTF-8?q?=E4=BC=9A=E7=9B=B4=E6=8E=A5=E8=BE=93=E5=87=BA=E5=B9=B6exit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/app.php | 4 ---- library/think/error.php | 6 +++--- library/think/route.php | 6 ++++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/library/think/app.php b/library/think/app.php index 699758f9..206210c0 100644 --- a/library/think/app.php +++ b/library/think/app.php @@ -25,10 +25,6 @@ class App */ public static function run(array $config = []) { - if (version_compare(PHP_VERSION, '5.4.0', '<')) { - throw new Exception('require PHP > 5.4.0 !'); - } - // 初始化公共模块 self::initModule(COMMON_MODULE, $config); diff --git a/library/think/error.php b/library/think/error.php index bbe077e0..6a6e68ec 100644 --- a/library/think/error.php +++ b/library/think/error.php @@ -124,12 +124,12 @@ class Error if (Config::get('show_error_msg')) { $e['message'] = is_array($error) ? $error['message'] : $error; } else { - $e['message'] = C('error_message'); + $e['message'] = Config::get('error_message'); } } } // 包含异常页面模板 - $data = include Config::get('exception_tmpl'); - exit(Response::returnData($data)); + include Config::get('exception_tmpl'); + exit; } } diff --git a/library/think/route.php b/library/think/route.php index 393a8743..f855fa3e 100644 --- a/library/think/route.php +++ b/library/think/route.php @@ -273,7 +273,8 @@ class Route // 正则路由 if ($route instanceof \Closure) { // 执行闭包 - return self::invokeRegx($route, $matches); + $result = self::invokeRegx($route, $matches); + return is_array($result) ? $result : exit($result); } return self::parseRegex($matches, $route, $regx); } @@ -297,7 +298,8 @@ class Route if (false !== $match = self::match($regx, $rule)) { if ($route instanceof \Closure) { // 执行闭包 - return self::invokeRule($route, $match); + $result = self::invokeRule($route, $match); + return is_array($result) ? $result : exit($result); } return self::parseRule($rule, $route, $regx); }