@@ -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; |
@@ -890,7 +890,7 @@ discard block |
||
890 | 890 | $appName = $map[$name]; |
891 | 891 | } |
892 | 892 | } elseif ($name && (false !== array_search($name, $map) || in_array($name, $deny))) { |
893 | - throw new HttpException(404, 'app not exists:' . $name); |
|
893 | + throw new HttpException(404, 'app not exists:'.$name); |
|
894 | 894 | } elseif ($name && isset($map['*'])) { |
895 | 895 | $appName = $map['*']; |
896 | 896 | } else { |
@@ -898,7 +898,7 @@ discard block |
||
898 | 898 | } |
899 | 899 | |
900 | 900 | if ($name) { |
901 | - $this->request->setRoot('/' . $name); |
|
901 | + $this->request->setRoot('/'.$name); |
|
902 | 902 | $url = strpos($url, '/') ? ltrim(strstr($url, '/'), '/') : ''; |
903 | 903 | $this->request->setPathinfo($url); |
904 | 904 | } |
@@ -935,9 +935,9 @@ discard block |
||
935 | 935 | $item = $this->domains[$this->host]; |
936 | 936 | } elseif (isset($this->domains[$subDomain])) { |
937 | 937 | $item = $this->domains[$subDomain]; |
938 | - } elseif (isset($this->domains['*.' . $domain2]) && !empty($domain3)) { |
|
938 | + } elseif (isset($this->domains['*.'.$domain2]) && !empty($domain3)) { |
|
939 | 939 | // 泛三级域名 |
940 | - $item = $this->domains['*.' . $domain2]; |
|
940 | + $item = $this->domains['*.'.$domain2]; |
|
941 | 941 | $panDomain = $domain3; |
942 | 942 | } elseif (isset($this->domains['*']) && !empty($domain2)) { |
943 | 943 | // 泛二级域名 |