@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | throw new FileLoggerException(__CLASS__.':'.sprintf('cannot create log file')); |
| 95 | 95 | } |
| 96 | 96 | $this->latest = $save.'/'.$this->getConfig('file-name'); |
| 97 | - register_shutdown_function([$this,'save']); |
|
| 97 | + register_shutdown_function([$this, 'save']); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | public function getDefaultConfig():array |
@@ -113,10 +113,10 @@ discard block |
||
| 113 | 113 | protected function packLogFile() |
| 114 | 114 | { |
| 115 | 115 | $logFile = $this->latest; |
| 116 | - $path = preg_replace('/[\\\\]+/', '/', $this->getConfig('save-zip-path') .'/'.date('Y-m-d').'.zip'); |
|
| 116 | + $path = preg_replace('/[\\\\]+/', '/', $this->getConfig('save-zip-path').'/'.date('Y-m-d').'.zip'); |
|
| 117 | 117 | $zip = $this->getZipArchive($path); |
| 118 | 118 | if ($zip !== null) { |
| 119 | - if ($zip->addFile($logFile, date('Y-m-d'). '-'. $zip->numFiles .'.log')) { |
|
| 119 | + if ($zip->addFile($logFile, date('Y-m-d').'-'.$zip->numFiles.'.log')) { |
|
| 120 | 120 | array_push($this->removeFiles, $logFile); |
| 121 | 121 | } |
| 122 | 122 | if (is_dir($this->getConfig('save-pack-path'))) { |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $zip->close(); |
| 131 | 131 | } else { |
| 132 | 132 | if (is_file($logFile) && file_exists($logFile)) { |
| 133 | - rename($logFile, $this->getConfig('save-path') . '/' . date('Y-m-d'). '-'. substr(md5_file($logFile), 0, 8).'.log'); |
|
| 133 | + rename($logFile, $this->getConfig('save-path').'/'.date('Y-m-d').'-'.substr(md5_file($logFile), 0, 8).'.log'); |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | } elseif (null === $val) { |
| 236 | 236 | $val = 'null'; |
| 237 | 237 | } |
| 238 | - $replace['{' . $key . '}'] = $val; |
|
| 238 | + $replace['{'.$key.'}'] = $val; |
|
| 239 | 239 | } |
| 240 | 240 | return strtr($message, $replace); |
| 241 | 241 | } |