@@ -8,7 +8,7 @@ |
||
8 | 8 | // +---------------------------------------------------------------------- |
9 | 9 | // | Author: 麦当苗儿 <[email protected]> <http://zjzit.cn> |
10 | 10 | // +---------------------------------------------------------------------- |
11 | -declare(strict_types = 1); |
|
11 | +declare(strict_types=1); |
|
12 | 12 | |
13 | 13 | namespace think\initializer; |
14 | 14 |
@@ -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 | |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | { |
66 | 66 | if (is_file($file)) { |
67 | 67 | $filename = $file; |
68 | - } elseif (is_file($this->path . $file . $this->ext)) { |
|
69 | - $filename = $this->path . $file . $this->ext; |
|
68 | + } elseif (is_file($this->path.$file.$this->ext)) { |
|
69 | + $filename = $this->path.$file.$this->ext; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | if (isset($filename)) { |
@@ -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 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function domain(bool $port = false): string |
365 | 365 | { |
366 | - return $this->scheme() . '://' . $this->host($port); |
|
366 | + return $this->scheme().'://'.$this->host($port); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | /** |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | if (!$root) { |
379 | 379 | $item = explode('.', $this->host()); |
380 | 380 | $count = count($item); |
381 | - $root = $count > 1 ? $item[$count - 2] . '.' . $item[$count - 1] : $item[0]; |
|
381 | + $root = $count > 1 ? $item[$count - 2].'.'.$item[$count - 1] : $item[0]; |
|
382 | 382 | } |
383 | 383 | |
384 | 384 | return $root; |
@@ -466,14 +466,14 @@ discard block |
||
466 | 466 | } elseif ($this->server('REQUEST_URI')) { |
467 | 467 | $url = $this->server('REQUEST_URI'); |
468 | 468 | } elseif ($this->server('ORIG_PATH_INFO')) { |
469 | - $url = $this->server('ORIG_PATH_INFO') . (!empty($this->server('QUERY_STRING')) ? '?' . $this->server('QUERY_STRING') : ''); |
|
469 | + $url = $this->server('ORIG_PATH_INFO').(!empty($this->server('QUERY_STRING')) ? '?'.$this->server('QUERY_STRING') : ''); |
|
470 | 470 | } elseif (isset($_SERVER['argv'][1])) { |
471 | 471 | $url = $_SERVER['argv'][1]; |
472 | 472 | } else { |
473 | 473 | $url = ''; |
474 | 474 | } |
475 | 475 | |
476 | - return $complete ? $this->domain() . $url : $url; |
|
476 | + return $complete ? $this->domain().$url : $url; |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | /** |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | $this->baseUrl = strpos($str, '?') ? strstr($str, '?', true) : $str; |
502 | 502 | } |
503 | 503 | |
504 | - return $complete ? $this->domain() . $this->baseUrl : $this->baseUrl; |
|
504 | + return $complete ? $this->domain().$this->baseUrl : $this->baseUrl; |
|
505 | 505 | } |
506 | 506 | |
507 | 507 | /** |
@@ -522,8 +522,8 @@ discard block |
||
522 | 522 | $url = $this->server('PHP_SELF'); |
523 | 523 | } elseif (basename($this->server('ORIG_SCRIPT_NAME')) === $script_name) { |
524 | 524 | $url = $this->server('ORIG_SCRIPT_NAME'); |
525 | - } elseif (($pos = strpos($this->server('PHP_SELF'), '/' . $script_name)) !== false) { |
|
526 | - $url = substr($this->server('SCRIPT_NAME'), 0, $pos) . '/' . $script_name; |
|
525 | + } elseif (($pos = strpos($this->server('PHP_SELF'), '/'.$script_name)) !== false) { |
|
526 | + $url = substr($this->server('SCRIPT_NAME'), 0, $pos).'/'.$script_name; |
|
527 | 527 | } elseif ($this->server('DOCUMENT_ROOT') && strpos($this->server('SCRIPT_FILENAME'), $this->server('DOCUMENT_ROOT')) === 0) { |
528 | 528 | $url = str_replace('\\', '/', str_replace($this->server('DOCUMENT_ROOT'), '', $this->server('SCRIPT_FILENAME'))); |
529 | 529 | } |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | $this->baseFile = $url; |
532 | 532 | } |
533 | 533 | |
534 | - return $complete ? $this->domain() . $this->baseFile : $this->baseFile; |
|
534 | + return $complete ? $this->domain().$this->baseFile : $this->baseFile; |
|
535 | 535 | } |
536 | 536 | |
537 | 537 | /** |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | $this->root = rtrim($file, '/'); |
563 | 563 | } |
564 | 564 | |
565 | - return $complete ? $this->domain() . $this->root : $this->root; |
|
565 | + return $complete ? $this->domain().$this->root : $this->root; |
|
566 | 566 | } |
567 | 567 | |
568 | 568 | /** |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | $root = strpos($base, '.') ? ltrim(dirname($base), DIRECTORY_SEPARATOR) : $base; |
577 | 577 | |
578 | 578 | if ('' != $root) { |
579 | - $root = '/' . ltrim($root, '/'); |
|
579 | + $root = '/'.ltrim($root, '/'); |
|
580 | 580 | } |
581 | 581 | |
582 | 582 | return $root; |
@@ -1317,7 +1317,7 @@ discard block |
||
1317 | 1317 | if (is_scalar($data)) { |
1318 | 1318 | $data = (string) $data; |
1319 | 1319 | } else { |
1320 | - throw new \InvalidArgumentException('variable type error:' . gettype($data)); |
|
1320 | + throw new \InvalidArgumentException('variable type error:'.gettype($data)); |
|
1321 | 1321 | } |
1322 | 1322 | break; |
1323 | 1323 | } |
@@ -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 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | foreach ($methods as $method) { |
188 | 188 | $name = $method->getName(); |
189 | 189 | if (0 === strpos($name, 'on')) { |
190 | - $this->listen($prefix . substr($name, 2), [$observer, $name]); |
|
190 | + $this->listen($prefix.substr($name, 2), [$observer, $name]); |
|
191 | 191 | } |
192 | 192 | } |
193 | 193 |
@@ -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\middleware; |
14 | 14 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | if ($this->lang->defaultLangSet() != $langset) { |
49 | 49 | // 加载系统语言包 |
50 | 50 | $this->lang->load([ |
51 | - $this->app->getThinkPath() . 'lang' . DIRECTORY_SEPARATOR . $langset . '.php', |
|
51 | + $this->app->getThinkPath().'lang'.DIRECTORY_SEPARATOR.$langset.'.php', |
|
52 | 52 | ]); |
53 | 53 | |
54 | 54 | $this->app->LoadLangPack($langset); |
@@ -8,7 +8,7 @@ |
||
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\middleware; |
14 | 14 |
@@ -8,7 +8,7 @@ |
||
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\middleware; |
14 | 14 |
@@ -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\middleware; |
14 | 14 | |
@@ -88,9 +88,9 @@ discard block |
||
88 | 88 | |
89 | 89 | if (isset($key) && 200 == $response->getCode() && $response->isAllowCache()) { |
90 | 90 | $header = $response->getHeader(); |
91 | - $header['Cache-Control'] = 'max-age=' . $expire . ',must-revalidate'; |
|
92 | - $header['Last-Modified'] = gmdate('D, d M Y H:i:s') . ' GMT'; |
|
93 | - $header['Expires'] = gmdate('D, d M Y H:i:s', time() + $expire) . ' GMT'; |
|
91 | + $header['Cache-Control'] = 'max-age='.$expire.',must-revalidate'; |
|
92 | + $header['Last-Modified'] = gmdate('D, d M Y H:i:s').' GMT'; |
|
93 | + $header['Expires'] = gmdate('D, d M Y H:i:s', time() + $expire).' GMT'; |
|
94 | 94 | |
95 | 95 | $this->cache->tag($tag)->set($key, [$response->getContent(), $header, time()], $expire); |
96 | 96 | } |
@@ -141,12 +141,12 @@ discard block |
||
141 | 141 | if (false !== strpos($key, ':')) { |
142 | 142 | $param = $request->param(); |
143 | 143 | foreach ($param as $item => $val) { |
144 | - if (is_string($val) && false !== strpos($key, ':' . $item)) { |
|
145 | - $key = str_replace(':' . $item, $val, $key); |
|
144 | + if (is_string($val) && false !== strpos($key, ':'.$item)) { |
|
145 | + $key = str_replace(':'.$item, $val, $key); |
|
146 | 146 | } |
147 | 147 | } |
148 | 148 | } elseif (strpos($key, ']')) { |
149 | - if ('[' . $request->ext() . ']' == $key) { |
|
149 | + if ('['.$request->ext().']' == $key) { |
|
150 | 150 | // 缓存某个后缀的请求 |
151 | 151 | $key = md5($request->url()); |
152 | 152 | } else { |
@@ -8,7 +8,7 @@ |
||
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\middleware; |
14 | 14 |