改进Route

This commit is contained in:
thinkphp
2016-01-17 12:09:31 +08:00
parent c1df565530
commit f926c3eb95
2 changed files with 50 additions and 46 deletions

View File

@@ -373,10 +373,13 @@ class App
$depr = $config['pathinfo_depr'];
// 路由检测
if (!empty($config['url_route_on'])) {
// 开启路由 注册路由定义文件
Route::register(!empty($config['route']) ? $config['route'] : null);
// 开启路由
if (!empty($config['route'])) {
// 注册路由定义文件
Route::register($config['route']);
}
// 路由检测根据路由定义返回不同的URL调度
$result = Route::check($_SERVER['PATH_INFO'], $depr);
$result = Route::check($_SERVER['PATH_INFO'], $depr, $Config['url_domain_deploy']);
if (false === $result) {
// 路由无效
if ($config['url_route_must']) {