@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | // +---------------------------------------------------------------------- |
| 9 | 9 | // | Author: liu21st <[email protected]> |
| 10 | 10 | // +---------------------------------------------------------------------- |
| 11 | -declare (strict_types = 1); |
|
| 11 | +declare(strict_types=1); |
|
| 12 | 12 | |
| 13 | 13 | namespace think; |
| 14 | 14 | |
@@ -175,9 +175,9 @@ discard block |
||
| 175 | 175 | $this->cache = $this->app->cache->store(true === $this->config['route_check_cache'] ? '' : $this->config['route_check_cache']); |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - if (is_file($this->app->getRuntimePath() . 'route.php')) { |
|
| 178 | + if (is_file($this->app->getRuntimePath().'route.php')) { |
|
| 179 | 179 | // 读取路由映射文件 |
| 180 | - $this->import(include $this->app->getRuntimePath() . 'route.php'); |
|
| 180 | + $this->import(include $this->app->getRuntimePath().'route.php'); |
|
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
@@ -390,13 +390,13 @@ discard block |
||
| 390 | 390 | if (is_null($domain)) { |
| 391 | 391 | $domain = $this->host; |
| 392 | 392 | } elseif (false === strpos($domain, '.')) { |
| 393 | - $domain .= '.' . $this->request->rootDomain(); |
|
| 393 | + $domain .= '.'.$this->request->rootDomain(); |
|
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | $subDomain = $this->request->subDomain(); |
| 397 | 397 | |
| 398 | 398 | if (strpos($subDomain, '.')) { |
| 399 | - $name = '*' . strstr($subDomain, '.'); |
|
| 399 | + $name = '*'.strstr($subDomain, '.'); |
|
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | if (isset($this->bind[$domain])) { |
@@ -727,7 +727,7 @@ discard block |
||
| 727 | 727 | $this->init(); |
| 728 | 728 | |
| 729 | 729 | if ($withRoute) { |
| 730 | - $checkCallback = function () use ($request, $withRoute) { |
|
| 730 | + $checkCallback = function() use ($request, $withRoute) { |
|
| 731 | 731 | //加载路由 |
| 732 | 732 | $withRoute(); |
| 733 | 733 | return $this->check(); |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | |
| 747 | 747 | $dispatch->init($this->app); |
| 748 | 748 | |
| 749 | - $this->app->middleware->add(function () use ($dispatch) { |
|
| 749 | + $this->app->middleware->add(function() use ($dispatch) { |
|
| 750 | 750 | try { |
| 751 | 751 | $response = $dispatch->run(); |
| 752 | 752 | } catch (HttpResponseException $exception) { |
@@ -770,7 +770,7 @@ discard block |
||
| 770 | 770 | $closure = $this->config['route_check_cache_key']; |
| 771 | 771 | $routeKey = $closure($request); |
| 772 | 772 | } else { |
| 773 | - $routeKey = md5($request->baseUrl(true) . ':' . $request->method()); |
|
| 773 | + $routeKey = md5($request->baseUrl(true).':'.$request->method()); |
|
| 774 | 774 | } |
| 775 | 775 | |
| 776 | 776 | return $routeKey; |
@@ -820,10 +820,10 @@ discard block |
||
| 820 | 820 | $path = $pathinfo; |
| 821 | 821 | } elseif ($suffix) { |
| 822 | 822 | // 去除正常的URL后缀 |
| 823 | - $path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo); |
|
| 823 | + $path = preg_replace('/\.('.ltrim($suffix, '.').')$/i', '', $pathinfo); |
|
| 824 | 824 | } else { |
| 825 | 825 | // 允许任何后缀访问 |
| 826 | - $path = preg_replace('/\.' . $this->request->ext() . '$/i', '', $pathinfo); |
|
| 826 | + $path = preg_replace('/\.'.$this->request->ext().'$/i', '', $pathinfo); |
|
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 | return $path; |
@@ -866,9 +866,9 @@ discard block |
||
| 866 | 866 | $item = $this->domains[$this->host]; |
| 867 | 867 | } elseif (isset($this->domains[$subDomain])) { |
| 868 | 868 | $item = $this->domains[$subDomain]; |
| 869 | - } elseif (isset($this->domains['*.' . $domain2]) && !empty($domain3)) { |
|
| 869 | + } elseif (isset($this->domains['*.'.$domain2]) && !empty($domain3)) { |
|
| 870 | 870 | // 泛三级域名 |
| 871 | - $item = $this->domains['*.' . $domain2]; |
|
| 871 | + $item = $this->domains['*.'.$domain2]; |
|
| 872 | 872 | $panDomain = $domain3; |
| 873 | 873 | } elseif (isset($this->domains['*']) && !empty($domain2)) { |
| 874 | 874 | // 泛二级域名 |