From 4db4a228a2f6abff0b60640c24974d34dc111dea Mon Sep 17 00:00:00 2001 From: luofei614 Date: Tue, 8 Dec 2015 05:01:50 -0500 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=87=A0=E5=A4=84notice?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- convention.php | 8 ++++++++ library/think/lang.php | 3 +++ library/think/route.php | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/convention.php b/convention.php index 942c4166..1208134f 100644 --- a/convention.php +++ b/convention.php @@ -56,6 +56,14 @@ return [ 'show_error_msg' => false, //默认输出类型 'default_return_type' => 'html', + //默认语言 + 'default_lang' => 'zh-cn', + //是否使用session + 'use_session' => true, + //url地址的后缀 + 'url_deny_suffix' => '', + //是否必须使用路由 + 'url_route_must' => false, 'log' => [ 'type' => 'File', diff --git a/library/think/lang.php b/library/think/lang.php index c5581fa4..16e6efa6 100644 --- a/library/think/lang.php +++ b/library/think/lang.php @@ -53,6 +53,9 @@ class Lang $range = $range ? $range : self::$range; $lang = is_file($file) ? include $file : []; // 批量定义 + if(!isset(self::$lang[$range])) { + self::$lang[$range] = []; + } return self::$lang[$range] = array_merge(self::$lang[$range], array_change_key_case($lang)); } diff --git a/library/think/route.php b/library/think/route.php index cd8b127c..08f5f7c2 100644 --- a/library/think/route.php +++ b/library/think/route.php @@ -327,7 +327,7 @@ class Route /** * 检查正则路由 */ - private function checkRegex($route, $url, $matches) + private static function checkRegex($route, $url, $matches) { // 正则路由 if ($route instanceof \Closure) { @@ -341,7 +341,7 @@ class Route /** * 检查规则路由 */ - private function checkRule($rule, $route, $url, $pattern) + private static function checkRule($rule, $route, $url, $pattern) { $len1 = substr_count($url, '/'); $len2 = substr_count($rule, '/');