@@ -101,11 +101,11 @@ |
||
| 101 | 101 | public function simulate(Target $target, Result $result) |
| 102 | 102 | { |
| 103 | 103 | $result->debug( |
| 104 | - 'sync backup to ' . $this->getProtocolName() . ' server' . PHP_EOL |
|
| 105 | - . ' host: ' . $this->host . PHP_EOL |
|
| 106 | - . ' user: ' . $this->user . PHP_EOL |
|
| 107 | - . ' password: ********' . PHP_EOL |
|
| 108 | - . ' path: ' . $this->remotePath |
|
| 104 | + 'sync backup to '.$this->getProtocolName().' server'.PHP_EOL |
|
| 105 | + . ' host: '.$this->host.PHP_EOL |
|
| 106 | + . ' user: '.$this->user.PHP_EOL |
|
| 107 | + . ' password: ********'.PHP_EOL |
|
| 108 | + . ' path: '.$this->remotePath |
|
| 109 | 109 | ); |
| 110 | 110 | } |
| 111 | 111 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | public function sync(Target $target, Result $result) |
| 77 | 77 | { |
| 78 | 78 | $sourcePath = $target->getPathname(); |
| 79 | - $dropboxPath = $this->path . $target->getFilename(); |
|
| 79 | + $dropboxPath = $this->path.$target->getFilename(); |
|
| 80 | 80 | $client = new DropboxApi\Client($this->token, "phpbu/1.1.0"); |
| 81 | 81 | $pathError = DropboxApi\Path::findErrorNonRoot($dropboxPath); |
| 82 | 82 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | } catch (\Exception $e) { |
| 101 | 101 | throw new Exception($e->getMessage(), null, $e); |
| 102 | 102 | } |
| 103 | - $result->debug('upload: done (' . $res['size'] . ')'); |
|
| 103 | + $result->debug('upload: done ('.$res['size'].')'); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -112,9 +112,9 @@ discard block |
||
| 112 | 112 | public function simulate(Target $target, Result $result) |
| 113 | 113 | { |
| 114 | 114 | $result->debug( |
| 115 | - 'sync backup to dropbox' . PHP_EOL |
|
| 116 | - . ' token: ********' . PHP_EOL |
|
| 117 | - . ' location: ' . $this->path |
|
| 115 | + 'sync backup to dropbox'.PHP_EOL |
|
| 116 | + . ' token: ********'.PHP_EOL |
|
| 117 | + . ' location: '.$this->path |
|
| 118 | 118 | ); |
| 119 | 119 | } |
| 120 | 120 | } |
@@ -118,11 +118,11 @@ |
||
| 118 | 118 | public function simulate(Target $target, Result $result) |
| 119 | 119 | { |
| 120 | 120 | $result->debug( |
| 121 | - 'sync backup to Amazon S3' . PHP_EOL |
|
| 122 | - . ' region: ' . $this->region . PHP_EOL |
|
| 123 | - . ' key: ' . $this->key . PHP_EOL |
|
| 124 | - . ' secret: ********' . PHP_EOL |
|
| 125 | - . ' location: ' . $this->bucket |
|
| 121 | + 'sync backup to Amazon S3'.PHP_EOL |
|
| 122 | + . ' region: '.$this->region.PHP_EOL |
|
| 123 | + . ' key: '.$this->key.PHP_EOL |
|
| 124 | + . ' secret: ********'.PHP_EOL |
|
| 125 | + . ' location: '.$this->bucket |
|
| 126 | 126 | ); |
| 127 | 127 | } |
| 128 | 128 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | // create regex to match only created backup files |
| 80 | 80 | $fileRegex = Str::datePlaceholdersToRegex($this->target->getFilenameRaw()); |
| 81 | 81 | if ($this->target->shouldBeCompressed()) { |
| 82 | - $fileRegex .= '.' . $this->target->getCompressor()->getSuffix(); |
|
| 82 | + $fileRegex .= '.'.$this->target->getCompressor()->getSuffix(); |
|
| 83 | 83 | } |
| 84 | 84 | /** @var \SplFileInfo $file */ |
| 85 | 85 | foreach ($dItter as $i => $file) { |
@@ -90,8 +90,8 @@ discard block |
||
| 90 | 90 | if ($file->getPathname() == $this->target->getPathname()) { |
| 91 | 91 | continue; |
| 92 | 92 | } |
| 93 | - if (preg_match('#' . $fileRegex . '#i', $file->getFilename())) { |
|
| 94 | - $index = date('YmdHis', $file->getMTime()) . '-' . $i . '-' . $file->getPathname(); |
|
| 93 | + if (preg_match('#'.$fileRegex.'#i', $file->getFilename())) { |
|
| 94 | + $index = date('YmdHis', $file->getMTime()).'-'.$i.'-'.$file->getPathname(); |
|
| 95 | 95 | $this->files[$index] = new File($file->getFileInfo()); |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | $result->debug($res->getCmd()); |
| 68 | 68 | |
| 69 | 69 | if (0 !== $res->getCode()) { |
| 70 | - throw new Exception('Failed to \'compress\' file: ' . $this->path); |
|
| 70 | + throw new Exception('Failed to \'compress\' file: '.$this->path); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | return $this->getArchiveFile($target); |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $this->pathElementsChanging[] = $d; |
| 152 | 152 | $foundChangingElement = true; |
| 153 | 153 | } else { |
| 154 | - $this->pathNotChanging .= DIRECTORY_SEPARATOR . $d; |
|
| 154 | + $this->pathNotChanging .= DIRECTORY_SEPARATOR.$d; |
|
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | // replace potential date placeholder |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | public function appendFileSuffix($suffix) |
| 187 | 187 | { |
| 188 | - $this->filename .= '.' . $suffix; |
|
| 188 | + $this->filename .= '.'.$suffix; |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
@@ -251,10 +251,10 @@ discard block |
||
| 251 | 251 | { |
| 252 | 252 | $suffix = ''; |
| 253 | 253 | if (!$plain) { |
| 254 | - $suffix .= $this->shouldBeCompressed() ? '.' . $this->compressor->getSuffix() : ''; |
|
| 255 | - $suffix .= $this->shouldBeEncrypted() ? '.' . $this->crypter->getSuffix() : ''; |
|
| 254 | + $suffix .= $this->shouldBeCompressed() ? '.'.$this->compressor->getSuffix() : ''; |
|
| 255 | + $suffix .= $this->shouldBeEncrypted() ? '.'.$this->crypter->getSuffix() : ''; |
|
| 256 | 256 | } |
| 257 | - return $this->filename . $suffix; |
|
| 257 | + return $this->filename.$suffix; |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | /** |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $result->debug($this->getExecutable($target)->getCommandLinePrintable()); |
| 124 | 124 | |
| 125 | 125 | if (!$innobackupex->wasSuccessful()) { |
| 126 | - throw new Exception('XtraBackup failed: ' . $innobackupex->getStdErr()); |
|
| 126 | + throw new Exception('XtraBackup failed: '.$innobackupex->getStdErr()); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | return $this->createStatus($target); |
@@ -170,6 +170,6 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | public function getDumpDir(Target $target) |
| 172 | 172 | { |
| 173 | - return $target->getPath() . '/dump'; |
|
| 173 | + return $target->getPath().'/dump'; |
|
| 174 | 174 | } |
| 175 | 175 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $saveResult = $redisSave->run(); |
| 107 | 107 | $result->debug($this->getExecutable($target)->getCommandLinePrintable()); |
| 108 | 108 | if (!$saveResult->wasSuccessful()) { |
| 109 | - throw new Exception('redis-cli BGSAVE failed:' . $saveResult->getStdErr()); |
|
| 109 | + throw new Exception('redis-cli BGSAVE failed:'.$saveResult->getStdErr()); |
|
| 110 | 110 | } |
| 111 | 111 | // check if the save process is finished |
| 112 | 112 | $this->isDumpCreatedYet($lastBackupTimestamp, $redisLast); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | private function copyDumpToTarget(Target $target) |
| 196 | 196 | { |
| 197 | 197 | if (!file_exists($this->pathToRedisData)) { |
| 198 | - throw new Exception('Redis data not found at: \'' . $this->pathToRedisCli . '\''); |
|
| 198 | + throw new Exception('Redis data not found at: \''.$this->pathToRedisCli.'\''); |
|
| 199 | 199 | } |
| 200 | 200 | $targetFile = $target->getPathnamePlain(); |
| 201 | 201 | copy($this->pathToRedisData, $targetFile); |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $result->debug($this->getExecutable($target)->getCommandLinePrintable()); |
| 204 | 204 | |
| 205 | 205 | if (!$mysqldump->wasSuccessful()) { |
| 206 | - throw new Exception('mysqldump failed:' . $mysqldump->getStdErr()); |
|
| 206 | + throw new Exception('mysqldump failed:'.$mysqldump->getStdErr()); |
|
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | return $this->createStatus($target); |
@@ -258,6 +258,6 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | private function getDumpTarget(Target $target) |
| 260 | 260 | { |
| 261 | - return $target->getPathnamePlain() . ($this->filePerTable ? '.dump' : ''); |
|
| 261 | + return $target->getPathnamePlain().($this->filePerTable ? '.dump' : ''); |
|
| 262 | 262 | } |
| 263 | 263 | } |