route类改进

This commit is contained in:
thinkphp
2015-12-04 08:48:44 +08:00
parent bd367d3beb
commit 6251b2ccdb
2 changed files with 7 additions and 3 deletions

View File

@@ -228,7 +228,10 @@ class App
// 检测域名部署 // 检测域名部署
if (!IS_CLI && !empty($config['domain_deploy'])) { if (!IS_CLI && !empty($config['domain_deploy'])) {
Route::checkDomain($config['domain_rules']); $module = Route::checkDomain($config['domain_rules']);
if (null != $module) {
define('BIND_MODULE', $module);
}
} }
// 监听path_info // 监听path_info

View File

@@ -194,7 +194,7 @@ class Route
exit; exit;
} }
if (is_array($rule)) { if (is_array($rule)) {
define('BIND_MODULE', $rule[0]); $module = $rule[0];
if (isset($rule[1])) { if (isset($rule[1])) {
// 传入参数 // 传入参数
parse_str($rule[1], $parms); parse_str($rule[1], $parms);
@@ -208,10 +208,11 @@ class Route
$_GET = array_merge($_GET, $parms); $_GET = array_merge($_GET, $parms);
} }
} else { } else {
define('BIND_MODULE', $rule); $module = $rule;
} }
} }
} }
return isset($module) ? $module : null;
} }
// 检测URL路由 // 检测URL路由