@@ -15,9 +15,9 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | public function __construct($logFile, $basePath = null) { |
| 17 | 17 | $this->logFile = $logFile; |
| 18 | - if ($basePath !== null) { |
|
| 18 | + if($basePath !== null) { |
|
| 19 | 19 | $this->basePath = $basePath; |
| 20 | - } else if (defined('DEPLOYNAUT_LOG_PATH')) { |
|
| 20 | + } else if(defined('DEPLOYNAUT_LOG_PATH')) { |
|
| 21 | 21 | $this->basePath = DEPLOYNAUT_LOG_PATH; |
| 22 | 22 | } else { |
| 23 | 23 | $this->basePath = sys_get_temp_dir(); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * @return string |
| 46 | 46 | */ |
| 47 | 47 | public function getRawFilePath() { |
| 48 | - return $this->basePath . '/' . $this->logFile; |
|
| 48 | + return $this->basePath.'/'.$this->logFile; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @return string |
| 54 | 54 | */ |
| 55 | 55 | public function getSanitisedLogFilePath() { |
| 56 | - return $this->basePath . '/' . strtolower(FileNameFilter::create()->filter($this->logFile)); |
|
| 56 | + return $this->basePath.'/'.strtolower(FileNameFilter::create()->filter($this->logFile)); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | $path = $this->getSanitisedLogFilePath(); |
| 65 | 65 | |
| 66 | 66 | // for backwards compatibility on old logs |
| 67 | - if (!file_exists($path)) { |
|
| 67 | + if(!file_exists($path)) { |
|
| 68 | 68 | $path = $this->getRawFilePath(); |
| 69 | 69 | |
| 70 | - if (!file_exists($path)) { |
|
| 70 | + if(!file_exists($path)) { |
|
| 71 | 71 | return null; |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | // Make sure we write into the old path for existing logs. New logs use the sanitised file path instead. |
| 84 | 84 | $path = file_exists($this->getRawFilePath()) ? $this->getRawFilePath() : $this->getSanitisedLogFilePath(); |
| 85 | 85 | |
| 86 | - error_log('[' . date('Y-m-d H:i:s') . '] ' . $message . PHP_EOL, 3, $path); |
|
| 86 | + error_log('['.date('Y-m-d H:i:s').'] '.$message.PHP_EOL, 3, $path); |
|
| 87 | 87 | @chmod($path, 0666); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @return bool |
| 93 | 93 | */ |
| 94 | 94 | public function exists() { |
| 95 | - return (bool) $this->getLogFilePath(); |
|
| 95 | + return (bool)$this->getLogFilePath(); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |