更新内核,API接口开发的一些尝试,后期会增加API接口开发这块

This commit is contained in:
2017-05-22 20:48:10 +08:00
parent a4d58f9f09
commit 426195eb90
47 changed files with 1339 additions and 513 deletions

View File

@@ -842,7 +842,7 @@ class Route
}
$method = strtolower($request->method());
// 获取当前请求类型的路由规则
$rules = self::$rules[$method];
$rules = isset(self::$rules[$method]) ? self::$rules[$method] : [];
// 检测域名部署
if ($checkDomain) {
self::checkDomain($request, $rules, $method);
@@ -924,7 +924,7 @@ class Route
} else {
$str = $key;
}
if (is_string($str) && $str && 0 !== strpos(str_replace('|', '/', $url), $str)) {
if (is_string($str) && $str && 0 !== stripos(str_replace('|', '/', $url), $str)) {
continue;
}
self::setOption($option);
@@ -1184,9 +1184,9 @@ class Route
}
}
$pattern = array_merge(self::$rules['pattern'], $pattern);
if (false !== $match = self::match($url, $rule, $pattern, $merge)) {
if (false !== $match = self::match($url, $rule, $pattern)) {
// 匹配到路由规则
return self::parseRule($rule, $route, $url, $option, $match, $merge);
return self::parseRule($rule, $route, $url, $option, $match);
}
}
return false;