内核更新

This commit is contained in:
2016-12-28 10:41:09 +08:00
parent c89254e12a
commit ffab826db0
65 changed files with 1194 additions and 610 deletions
+7 -9
View File
@@ -11,11 +11,6 @@
namespace think;
use think\Config;
use think\Loader;
use think\Request;
use think\Route;
class Url
{
// 生成URL地址的root
@@ -89,7 +84,8 @@ class Url
throw new \InvalidArgumentException('route name not exists:' . $name);
} else {
// 检查别名路由
$alias = Route::rules('alias');
$alias = Route::rules('alias');
$matchAlias = false;
if ($alias) {
// 别名路由解析
foreach ($alias as $key => $val) {
@@ -97,11 +93,13 @@ class Url
$val = $val[0];
}
if (0 === strpos($url, $val)) {
$url = $key . substr($url, strlen($val));
$url = $key . substr($url, strlen($val));
$matchAlias = true;
break;
}
}
} else {
}
if (!$matchAlias) {
// 路由标识不存在 直接解析
$url = self::parseUrl($url, $domain);
}
@@ -250,7 +248,7 @@ class Url
$domain .= $rootDomain;
}
break;
} else if (false !== strpos($key, '*')) {
} elseif (false !== strpos($key, '*')) {
if (!empty($rootDomain)) {
$domain .= $rootDomain;
}