@@ -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 | |
@@ -177,9 +177,9 @@ discard block |
||
| 177 | 177 | $this->ruleName = new RuleName(); |
| 178 | 178 | $this->setDefaultDomain(); |
| 179 | 179 | |
| 180 | - if (is_file($this->app->getRuntimePath() . 'route.php')) { |
|
| 180 | + if (is_file($this->app->getRuntimePath().'route.php')) { |
|
| 181 | 181 | // 读取路由映射文件 |
| 182 | - $this->import(include $this->app->getRuntimePath() . 'route.php'); |
|
| 182 | + $this->import(include $this->app->getRuntimePath().'route.php'); |
|
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | |
@@ -420,13 +420,13 @@ discard block |
||
| 420 | 420 | if (is_null($domain)) { |
| 421 | 421 | $domain = $this->host; |
| 422 | 422 | } elseif (false === strpos($domain, '.')) { |
| 423 | - $domain .= '.' . $this->request->rootDomain(); |
|
| 423 | + $domain .= '.'.$this->request->rootDomain(); |
|
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | $subDomain = $this->request->subDomain(); |
| 427 | 427 | |
| 428 | 428 | if (strpos($subDomain, '.')) { |
| 429 | - $name = '*' . strstr($subDomain, '.'); |
|
| 429 | + $name = '*'.strstr($subDomain, '.'); |
|
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | if (isset($this->bind[$domain])) { |
@@ -773,9 +773,9 @@ discard block |
||
| 773 | 773 | |
| 774 | 774 | return $this->app->middleware->pipeline() |
| 775 | 775 | ->send($request) |
| 776 | - ->then(function ($request) use ($withRoute) { |
|
| 776 | + ->then(function($request) use ($withRoute) { |
|
| 777 | 777 | if ($withRoute) { |
| 778 | - $checkCallback = function () use ($withRoute) { |
|
| 778 | + $checkCallback = function() use ($withRoute) { |
|
| 779 | 779 | //加载路由 |
| 780 | 780 | $withRoute(); |
| 781 | 781 | return $this->check(); |
@@ -810,7 +810,7 @@ discard block |
||
| 810 | 810 | $closure = $this->config['route_check_cache_key']; |
| 811 | 811 | $routeKey = $closure($request); |
| 812 | 812 | } else { |
| 813 | - $routeKey = md5($request->baseUrl(true) . ':' . $request->method()); |
|
| 813 | + $routeKey = md5($request->baseUrl(true).':'.$request->method()); |
|
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | return $routeKey; |
@@ -860,10 +860,10 @@ discard block |
||
| 860 | 860 | $path = $pathinfo; |
| 861 | 861 | } elseif ($suffix) { |
| 862 | 862 | // 去除正常的URL后缀 |
| 863 | - $path = preg_replace('/\.(' . ltrim($suffix, '.') . ')$/i', '', $pathinfo); |
|
| 863 | + $path = preg_replace('/\.('.ltrim($suffix, '.').')$/i', '', $pathinfo); |
|
| 864 | 864 | } else { |
| 865 | 865 | // 允许任何后缀访问 |
| 866 | - $path = preg_replace('/\.' . $this->request->ext() . '$/i', '', $pathinfo); |
|
| 866 | + $path = preg_replace('/\.'.$this->request->ext().'$/i', '', $pathinfo); |
|
| 867 | 867 | } |
| 868 | 868 | |
| 869 | 869 | return $path; |
@@ -892,7 +892,7 @@ discard block |
||
| 892 | 892 | $appName = $map[$name]; |
| 893 | 893 | } |
| 894 | 894 | } elseif ($name && (false !== array_search($name, $map) || in_array($name, $deny))) { |
| 895 | - throw new HttpException(404, 'app not exists:' . $name); |
|
| 895 | + throw new HttpException(404, 'app not exists:'.$name); |
|
| 896 | 896 | } elseif ($name && isset($map['*'])) { |
| 897 | 897 | $appName = $map['*']; |
| 898 | 898 | } else { |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | } |
| 901 | 901 | |
| 902 | 902 | if ($name) { |
| 903 | - $this->request->setRoot('/' . $name); |
|
| 903 | + $this->request->setRoot('/'.$name); |
|
| 904 | 904 | $url = strpos($url, '|') ? ltrim(strstr($url, '|'), '|') : ''; |
| 905 | 905 | $this->request->setPathinfo(str_replace('|', $this->config['pathinfo_depr'], $url)); |
| 906 | 906 | } |
@@ -937,9 +937,9 @@ discard block |
||
| 937 | 937 | $item = $this->domains[$this->host]; |
| 938 | 938 | } elseif (isset($this->domains[$subDomain])) { |
| 939 | 939 | $item = $this->domains[$subDomain]; |
| 940 | - } elseif (isset($this->domains['*.' . $domain2]) && !empty($domain3)) { |
|
| 940 | + } elseif (isset($this->domains['*.'.$domain2]) && !empty($domain3)) { |
|
| 941 | 941 | // 泛三级域名 |
| 942 | - $item = $this->domains['*.' . $domain2]; |
|
| 942 | + $item = $this->domains['*.'.$domain2]; |
|
| 943 | 943 | $panDomain = $domain3; |
| 944 | 944 | } elseif (isset($this->domains['*']) && !empty($domain2)) { |
| 945 | 945 | // 泛二级域名 |