From 2f6963e8ea9c9d1ef5cebc5c775a63a0a3e43261 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 22 Nov 2015 21:45:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B7=AF=E7=94=B1=E5=BC=80?= =?UTF-8?q?=E5=85=B3url=5Froute=5Fon=20=E8=B7=AF=E7=94=B1=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=94=B9=E4=B8=BAurl=5Froute=5Frules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/app.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/library/think/app.php b/library/think/app.php index df219b08..6102e525 100644 --- a/library/think/app.php +++ b/library/think/app.php @@ -254,12 +254,15 @@ class App throw new Exception('URL_SUFFIX_DENY'); } // 路由检测 - Route::register($config['routes']); - Route::check($_SERVER['PATH_INFO'], $config['pathinfo_depr']); + if (!empty($config['url_route_on'])) { + // 开启路由 则检测路由配置 并默认读取 url_route_rules 参数 + Route::register($config['url_route_rules']); + Route::check($_SERVER['PATH_INFO'], $config['pathinfo_depr']); + } // 获取URL中的模块名 if ($config['require_module'] && !isset($_GET[VAR_MODULE])) { - $paths = explode($config['pathinfo_depr'], __INFO__, 2); + $paths = explode($config['pathinfo_depr'], __INFO__, 2); $_GET[VAR_MODULE] = array_shift($paths); $_SERVER['PATH_INFO'] = implode('/', $paths); }