/** * url Route detection (based on path_info) * @access public * @param \think\ request $request * @param array $config * @return array * @throws \think\exception */public static function routecheck ($request, array $config) { $path = $request->path (); $depr = $config [' Pathinfo_depr ']; $result = false; // Route detection $check = !is_null (self:: $routeCheck) ? self:: $routeCheck : $ config[' url_route_on ']; if ($check) { // Open Routing if (Is_file (runtime_path . ' route.php ') { // Read route cache $rules = include RUNTIME_PATH . ' route.php '; if (Is_array ($rules)) { route::rules ($ Rules); } } else { $ files = $config [' Route_config_file ']; foreach ($files as $file) { if (Is_file (conf_path . $file . conf_ EXT))  {  &NBsp; // Import Routing configuration $rules = include CONF_PATH . $file . CONF_EXT; if (Is_array ($rules)) { route::import ($rules); } } } } // route detection (returns different URL schedules based on the route definition) $ Result = route::check ($request, $path, $depr, $config [' Url_domain_deploy ']); $must = !is_null (self:: $routeMust) ? self:: $routeMust : $config [' Url_route_must ']; if ($must && false === $result) { // Invalid route throw new httpexception (404, ' route not found '); } } if (false === $result ) { // Invalid route Resolution module/controller/operation/parameter ... support Auto search for controller $result = route::p arseurl ($path, $depr, $config [' Controller_auto_search ']); } return $result;}
This article is from the "Focus on PHP Group number: 414194301" blog, please be sure to keep this source http://jingshanls.blog.51cto.com/3357095/1860468
[Li Jingshan php] every day tp5-20161213| App.php-3