增加路由开关url_route_on

路由参数改为url_route_rules
This commit is contained in:
thinkphp
2015-11-22 21:45:25 +08:00
parent 6c08b6cfe1
commit 2f6963e8ea

View File

@@ -254,8 +254,11 @@ class App
throw new Exception('URL_SUFFIX_DENY'); throw new Exception('URL_SUFFIX_DENY');
} }
// 路由检测 // 路由检测
Route::register($config['routes']); if (!empty($config['url_route_on'])) {
// 开启路由 则检测路由配置 并默认读取 url_route_rules 参数
Route::register($config['url_route_rules']);
Route::check($_SERVER['PATH_INFO'], $config['pathinfo_depr']); Route::check($_SERVER['PATH_INFO'], $config['pathinfo_depr']);
}
// 获取URL中的模块名 // 获取URL中的模块名
if ($config['require_module'] && !isset($_GET[VAR_MODULE])) { if ($config['require_module'] && !isset($_GET[VAR_MODULE])) {