@@ -2,13 +2,13 @@ |
||
| 2 | 2 | $host = $argv[1] ?? '127.0.0.1:9501'; |
| 3 | 3 | list($ip, $port) = explode(':', $host); |
| 4 | 4 | |
| 5 | -define('SUDA_APP', __DIR__ . '/app'); |
|
| 6 | -define('SUDA_DATA', __DIR__ . '/data'); |
|
| 7 | -define('SUDA_SYSTEM', __DIR__ . '/suda'); |
|
| 5 | +define('SUDA_APP', __DIR__.'/app'); |
|
| 6 | +define('SUDA_DATA', __DIR__.'/data'); |
|
| 7 | +define('SUDA_SYSTEM', __DIR__.'/suda'); |
|
| 8 | 8 | define('SUDA_PUBLIC', __DIR__); |
| 9 | 9 | define('SUDA_DEBUG', true); |
| 10 | 10 | define('SUDA_DEBUG_LEVEL', 'info'); |
| 11 | -define('SUDA_APP_MANIFEST', SUDA_APP . '/manifest'); |
|
| 11 | +define('SUDA_APP_MANIFEST', SUDA_APP.'/manifest'); |
|
| 12 | 12 | |
| 13 | 13 | // 设置IP或者端口 |
| 14 | 14 | define('SUDA_SWOOLE_IP', $ip); |
@@ -91,14 +91,14 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | $msec = explode('.', microtime(true))[1]; |
| 93 | 93 | $save = $this->getConfig('save-path'); |
| 94 | - $this->tempName = $save . '/' . date('YmdHis') . '.' . $msec . '.log'; |
|
| 94 | + $this->tempName = $save.'/'.date('YmdHis').'.'.$msec.'.log'; |
|
| 95 | 95 | $temp = fopen($this->tempName, 'w+'); |
| 96 | 96 | if ($temp !== false) { |
| 97 | 97 | $this->temp = $temp; |
| 98 | 98 | } else { |
| 99 | - throw new FileLoggerException(__METHOD__ . ':' . sprintf('cannot create log file')); |
|
| 99 | + throw new FileLoggerException(__METHOD__.':'.sprintf('cannot create log file')); |
|
| 100 | 100 | } |
| 101 | - $this->latest = $save . '/' . $this->getConfig('file-name'); |
|
| 101 | + $this->latest = $save.'/'.$this->getConfig('file-name'); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | $path = preg_replace( |
| 127 | 127 | '/[\\\\]+/', |
| 128 | 128 | '/', |
| 129 | - $this->getConfig('save-zip-path') . '/' . date('Y-m-d') . '.zip' |
|
| 129 | + $this->getConfig('save-zip-path').'/'.date('Y-m-d').'.zip' |
|
| 130 | 130 | ); |
| 131 | 131 | $zip = $this->getZipArchive($path); |
| 132 | 132 | if ($zip !== null) { |
| 133 | - if ($zip->addFile($logFile, date('Y-m-d') . '-' . $zip->numFiles . '.log')) { |
|
| 133 | + if ($zip->addFile($logFile, date('Y-m-d').'-'.$zip->numFiles.'.log')) { |
|
| 134 | 134 | array_push($this->removeFiles, $logFile); |
| 135 | 135 | } |
| 136 | 136 | if (is_dir($this->getConfig('save-dump-path'))) { |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | RecursiveDirectoryIterator::SKIP_DOTS |
| 140 | 140 | )); |
| 141 | 141 | foreach ($it as $dumpLog) { |
| 142 | - if ($zip->addFile($dumpLog, 'dump/' . basename($dumpLog))) { |
|
| 142 | + if ($zip->addFile($dumpLog, 'dump/'.basename($dumpLog))) { |
|
| 143 | 143 | array_push($this->removeFiles, $dumpLog); |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -150,8 +150,8 @@ discard block |
||
| 150 | 150 | rename( |
| 151 | 151 | $logFile, |
| 152 | 152 | $this->getConfig('save-path') |
| 153 | - . '/' . date('Y-m-d') |
|
| 154 | - . '-' . substr(md5_file($logFile), 0, 8) . '.log' |
|
| 153 | + . '/'.date('Y-m-d') |
|
| 154 | + . '-'.substr(md5_file($logFile), 0, 8).'.log' |
|
| 155 | 155 | ); |
| 156 | 156 | } |
| 157 | 157 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $replace['%level%'] = $level; |
| 208 | 208 | $replace['%message%'] = $message; |
| 209 | 209 | $write = strtr($this->getConfig('log-format'), $replace); |
| 210 | - fwrite($this->getAvailableWrite(), $write . PHP_EOL); |
|
| 210 | + fwrite($this->getAvailableWrite(), $write.PHP_EOL); |
|
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | } elseif (null === $val) { |
| 284 | 284 | $val = 'null'; |
| 285 | 285 | } |
| 286 | - $replace['{' . $key . '}'] = $val; |
|
| 286 | + $replace['{'.$key.'}'] = $val; |
|
| 287 | 287 | } |
| 288 | 288 | return strtr($message, $replace); |
| 289 | 289 | } |