@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | */ |
38 | 38 | protected function parseDsn($config) |
39 | 39 | { |
40 | - $dsn = 'pgsql:dbname=' . $config['database'] . ';host=' . $config['hostname']; |
|
40 | + $dsn = 'pgsql:dbname='.$config['database'].';host='.$config['hostname']; |
|
41 | 41 | |
42 | 42 | if (!empty($config['hostport'])) { |
43 | - $dsn .= ';port=' . $config['hostport']; |
|
43 | + $dsn .= ';port='.$config['hostport']; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | return $dsn; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | public function getFields($tableName) |
56 | 56 | { |
57 | 57 | list($tableName) = explode(' ', $tableName); |
58 | - $sql = 'select fields_name as "field",fields_type as "type",fields_not_null as "null",fields_key_name as "key",fields_default as "default",fields_default as "extra" from table_msg(\'' . $tableName . '\');'; |
|
58 | + $sql = 'select fields_name as "field",fields_type as "type",fields_not_null as "null",fields_key_name as "key",fields_default as "default",fields_default as "extra" from table_msg(\''.$tableName.'\');'; |
|
59 | 59 | |
60 | 60 | $pdo = $this->query($sql, [], false, true); |
61 | 61 | $result = $pdo->fetchAll(PDO::FETCH_ASSOC); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function getThroughputRate() |
111 | 111 | { |
112 | - return number_format(1 / $this->getUseTime(), 2) . 'req/s'; |
|
112 | + return number_format(1 / $this->getUseTime(), 2).'req/s'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $pos++; |
136 | 136 | } |
137 | 137 | |
138 | - return round($size, $dec) . " " . $a[$pos]; |
|
138 | + return round($size, $dec)." ".$a[$pos]; |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $pos++; |
156 | 156 | } |
157 | 157 | |
158 | - return round($size, $dec) . " " . $a[$pos]; |
|
158 | + return round($size, $dec)." ".$a[$pos]; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $pos++; |
182 | 182 | } |
183 | 183 | |
184 | - return round($size, $dec) . " " . $a[$pos]; |
|
184 | + return round($size, $dec)." ".$a[$pos]; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $info = []; |
198 | 198 | |
199 | 199 | foreach ($files as $key => $file) { |
200 | - $info[] = $file . ' ( ' . number_format(filesize($file) / 1024, 2) . ' KB )'; |
|
200 | + $info[] = $file.' ( '.number_format(filesize($file) / 1024, 2).' KB )'; |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | return $info; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | */ |
218 | 218 | public function dump($var, $echo = true, $label = null, $flags = ENT_SUBSTITUTE) |
219 | 219 | { |
220 | - $label = (null === $label) ? '' : rtrim($label) . ':'; |
|
220 | + $label = (null === $label) ? '' : rtrim($label).':'; |
|
221 | 221 | if ($var instanceof Model || $var instanceof ModelCollection) { |
222 | 222 | $var = $var->toArray(); |
223 | 223 | } |
@@ -229,12 +229,12 @@ discard block |
||
229 | 229 | $output = preg_replace('/\]\=\>\n(\s+)/m', '] => ', $output); |
230 | 230 | |
231 | 231 | if (PHP_SAPI == 'cli') { |
232 | - $output = PHP_EOL . $label . $output . PHP_EOL; |
|
232 | + $output = PHP_EOL.$label.$output.PHP_EOL; |
|
233 | 233 | } else { |
234 | 234 | if (!extension_loaded('xdebug')) { |
235 | 235 | $output = htmlspecialchars($output, $flags); |
236 | 236 | } |
237 | - $output = '<pre>' . $label . $output . '</pre>'; |
|
237 | + $output = '<pre>'.$label.$output.'</pre>'; |
|
238 | 238 | } |
239 | 239 | if ($echo) { |
240 | 240 | echo($output); |
@@ -260,9 +260,9 @@ discard block |
||
260 | 260 | // trace调试信息注入 |
261 | 261 | $pos = strripos($content, '</body>'); |
262 | 262 | if (false !== $pos) { |
263 | - $content = substr($content, 0, $pos) . $output . substr($content, $pos); |
|
263 | + $content = substr($content, 0, $pos).$output.substr($content, $pos); |
|
264 | 264 | } else { |
265 | - $content = $content . $output; |
|
265 | + $content = $content.$output; |
|
266 | 266 | } |
267 | 267 | } |
268 | 268 | } |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | { |
118 | 118 | if (is_file($file)) { |
119 | 119 | $filename = $file; |
120 | - } elseif (is_file($this->path . $file . $this->ext)) { |
|
121 | - $filename = $this->path . $file . $this->ext; |
|
120 | + } elseif (is_file($this->path.$file.$this->ext)) { |
|
121 | + $filename = $this->path.$file.$this->ext; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | if (isset($filename)) { |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | protected function getYaconfName($name) |
140 | 140 | { |
141 | 141 | if ($this->yaconf && is_string($this->yaconf)) { |
142 | - return $this->yaconf . '.' . $name; |
|
142 | + return $this->yaconf.'.'.$name; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | return $name; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | public function has($name) |
189 | 189 | { |
190 | 190 | if (false === strpos($name, '.')) { |
191 | - $name = $this->prefix . '.' . $name; |
|
191 | + $name = $this->prefix.'.'.$name; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | return !is_null($this->get($name)); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | public function get($name = null, $default = null) |
227 | 227 | { |
228 | 228 | if ($name && false === strpos($name, '.')) { |
229 | - $name = $this->prefix . '.' . $name; |
|
229 | + $name = $this->prefix.'.'.$name; |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | // 无参数时获取所有 |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | { |
274 | 274 | if (is_string($name)) { |
275 | 275 | if (false === strpos($name, '.')) { |
276 | - $name = $this->prefix . '.' . $name; |
|
276 | + $name = $this->prefix.'.'.$name; |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | $name = explode('.', $name, 3); |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | public function remove($name) |
316 | 316 | { |
317 | 317 | if (false === strpos($name, '.')) { |
318 | - $name = $this->prefix . '.' . $name; |
|
318 | + $name = $this->prefix.'.'.$name; |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | $name = explode('.', $name, 3); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | protected function getAvailablePageWrapper($url, $page) |
138 | 138 | { |
139 | - return '<li><a href="' . htmlentities($url) . '">' . $page . '</a></li>'; |
|
139 | + return '<li><a href="'.htmlentities($url).'">'.$page.'</a></li>'; |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | protected function getDisabledTextWrapper($text) |
149 | 149 | { |
150 | - return '<li class="disabled"><span>' . $text . '</span></li>'; |
|
150 | + return '<li class="disabled"><span>'.$text.'</span></li>'; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | protected function getActivePageWrapper($text) |
160 | 160 | { |
161 | - return '<li class="active"><span>' . $text . '</span></li>'; |
|
161 | + return '<li class="active"><span>'.$text.'</span></li>'; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function read($sessID) |
98 | 98 | { |
99 | - return (string) $this->handler->get($this->config['session_name'] . $sessID); |
|
99 | + return (string) $this->handler->get($this->config['session_name'].$sessID); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function write($sessID, $sessData) |
110 | 110 | { |
111 | - return $this->handler->set($this->config['session_name'] . $sessID, $sessData, $this->config['expire']); |
|
111 | + return $this->handler->set($this->config['session_name'].$sessID, $sessData, $this->config['expire']); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function destroy($sessID) |
121 | 121 | { |
122 | - return $this->handler->delete($this->config['session_name'] . $sessID); |
|
122 | + return $this->handler->delete($this->config['session_name'].$sessID); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -58,8 +58,7 @@ discard block |
||
58 | 58 | foreach ((array) $hosts as $i => $host) { |
59 | 59 | $port = isset($ports[$i]) ? $ports[$i] : $ports[0]; |
60 | 60 | $this->config['timeout'] > 0 ? |
61 | - $this->handler->addServer($host, $port, $this->config['persistent'], 1, $this->config['timeout']) : |
|
62 | - $this->handler->addServer($host, $port, $this->config['persistent'], 1); |
|
61 | + $this->handler->addServer($host, $port, $this->config['persistent'], 1, $this->config['timeout']) : $this->handler->addServer($host, $port, $this->config['persistent'], 1); |
|
63 | 62 | } |
64 | 63 | |
65 | 64 | return true; |
@@ -85,7 +84,7 @@ discard block |
||
85 | 84 | */ |
86 | 85 | public function read($sessID) |
87 | 86 | { |
88 | - return (string) $this->handler->get($this->config['session_name'] . $sessID); |
|
87 | + return (string) $this->handler->get($this->config['session_name'].$sessID); |
|
89 | 88 | } |
90 | 89 | |
91 | 90 | /** |
@@ -97,7 +96,7 @@ discard block |
||
97 | 96 | */ |
98 | 97 | public function write($sessID, $sessData) |
99 | 98 | { |
100 | - return $this->handler->set($this->config['session_name'] . $sessID, $sessData, 0, $this->config['expire']); |
|
99 | + return $this->handler->set($this->config['session_name'].$sessID, $sessData, 0, $this->config['expire']); |
|
101 | 100 | } |
102 | 101 | |
103 | 102 | /** |
@@ -108,7 +107,7 @@ discard block |
||
108 | 107 | */ |
109 | 108 | public function destroy($sessID) |
110 | 109 | { |
111 | - return $this->handler->delete($this->config['session_name'] . $sessID); |
|
110 | + return $this->handler->delete($this->config['session_name'].$sessID); |
|
112 | 111 | } |
113 | 112 | |
114 | 113 | /** |
@@ -323,7 +323,7 @@ |
||
323 | 323 | |
324 | 324 | // 全局作用域 |
325 | 325 | if (true === $useBaseQuery && method_exists($this, 'base')) { |
326 | - call_user_func_array([$this, 'base'], [ & $query]); |
|
326 | + call_user_func_array([$this, 'base'], [& $query]); |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | $globalScope = is_array($useBaseQuery) && $useBaseQuery ? $useBaseQuery : $this->globalScope; |
@@ -356,10 +356,10 @@ discard block |
||
356 | 356 | return false; |
357 | 357 | } |
358 | 358 | |
359 | - $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
359 | + $path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
360 | 360 | // 文件保存命名规则 |
361 | 361 | $saveName = $this->buildSaveName($savename, $autoAppendExt); |
362 | - $filename = $path . $saveName; |
|
362 | + $filename = $path.$saveName; |
|
363 | 363 | |
364 | 364 | // 检测目录 |
365 | 365 | if (false === $this->checkPath(dirname($filename))) { |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | } |
407 | 407 | |
408 | 408 | if ($autoAppendExt && false === strpos($savename, '.')) { |
409 | - $savename .= '.' . pathinfo($this->getInfo('name'), PATHINFO_EXTENSION); |
|
409 | + $savename .= '.'.pathinfo($this->getInfo('name'), PATHINFO_EXTENSION); |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | return $savename; |
@@ -424,16 +424,16 @@ discard block |
||
424 | 424 | } else { |
425 | 425 | switch ($this->rule) { |
426 | 426 | case 'date': |
427 | - $savename = date('Ymd') . DIRECTORY_SEPARATOR . md5(microtime(true)); |
|
427 | + $savename = date('Ymd').DIRECTORY_SEPARATOR.md5(microtime(true)); |
|
428 | 428 | break; |
429 | 429 | default: |
430 | 430 | if (in_array($this->rule, hash_algos())) { |
431 | 431 | $hash = $this->hash($this->rule); |
432 | - $savename = substr($hash, 0, 2) . DIRECTORY_SEPARATOR . substr($hash, 2); |
|
432 | + $savename = substr($hash, 0, 2).DIRECTORY_SEPARATOR.substr($hash, 2); |
|
433 | 433 | } elseif (is_callable($this->rule)) { |
434 | 434 | $savename = call_user_func($this->rule); |
435 | 435 | } else { |
436 | - $savename = date('Ymd') . DIRECTORY_SEPARATOR . md5(microtime(true)); |
|
436 | + $savename = date('Ymd').DIRECTORY_SEPARATOR.md5(microtime(true)); |
|
437 | 437 | } |
438 | 438 | } |
439 | 439 | } |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | $domainName = is_array($name) ? array_shift($name) : $name; |
328 | 328 | |
329 | 329 | if ('*' != $domainName && false === strpos($domainName, '.')) { |
330 | - $domainName .= '.' . $this->request->rootDomain(); |
|
330 | + $domainName .= '.'.$this->request->rootDomain(); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | if (!isset($this->domains[$domainName])) { |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | $root = $this->request->rootDomain(); |
346 | 346 | foreach ($name as $item) { |
347 | 347 | if (false === strpos($item, '.')) { |
348 | - $item .= '.' . $root; |
|
348 | + $item .= '.'.$root; |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | $this->domains[$item] = $domainName; |
@@ -395,13 +395,13 @@ discard block |
||
395 | 395 | } elseif (true === $domain) { |
396 | 396 | return $this->bind; |
397 | 397 | } elseif (false === strpos($domain, '.')) { |
398 | - $domain .= '.' . $this->request->rootDomain(); |
|
398 | + $domain .= '.'.$this->request->rootDomain(); |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | $subDomain = $this->request->subDomain(); |
402 | 402 | |
403 | 403 | if (strpos($subDomain, '.')) { |
404 | - $name = '*' . strstr($subDomain, '.'); |
|
404 | + $name = '*'.strstr($subDomain, '.'); |
|
405 | 405 | } |
406 | 406 | |
407 | 407 | if (isset($this->bind[$domain])) { |
@@ -709,10 +709,10 @@ discard block |
||
709 | 709 | $group = new RuleGroup($this, $this->group, $rule, null, $option, $pattern); |
710 | 710 | |
711 | 711 | foreach ($this->methodPrefix as $type => $val) { |
712 | - $group->addRule('<action>', $val . '<action>', $type); |
|
712 | + $group->addRule('<action>', $val.'<action>', $type); |
|
713 | 713 | } |
714 | 714 | |
715 | - return $group->prefix($route . '/'); |
|
715 | + return $group->prefix($route.'/'); |
|
716 | 716 | } |
717 | 717 | |
718 | 718 | /** |
@@ -927,9 +927,9 @@ discard block |
||
927 | 927 | if ($subDomain && isset($this->domains[$subDomain])) { |
928 | 928 | // 子域名配置 |
929 | 929 | $item = $this->domains[$subDomain]; |
930 | - } elseif (isset($this->domains['*.' . $domain2]) && !empty($domain3)) { |
|
930 | + } elseif (isset($this->domains['*.'.$domain2]) && !empty($domain3)) { |
|
931 | 931 | // 泛三级域名 |
932 | - $item = $this->domains['*.' . $domain2]; |
|
932 | + $item = $this->domains['*.'.$domain2]; |
|
933 | 933 | $panDomain = $domain3; |
934 | 934 | } elseif (isset($this->domains['*']) && !empty($domain2)) { |
935 | 935 | // 泛二级域名 |