@@ -74,11 +74,11 @@ |
||
| 74 | 74 | ); |
| 75 | 75 | } else { |
| 76 | 76 | $executable->fromHost($this->host) |
| 77 | - ->fromUser($this->user) |
|
| 78 | - ->fromPath($this->path) |
|
| 79 | - ->toPath($this->getRsyncLocation($target, true)) |
|
| 80 | - ->removeDeleted($this->delete) |
|
| 81 | - ->exclude($this->excludes); |
|
| 77 | + ->fromUser($this->user) |
|
| 78 | + ->fromPath($this->path) |
|
| 79 | + ->toPath($this->getRsyncLocation($target, true)) |
|
| 80 | + ->removeDeleted($this->delete) |
|
| 81 | + ->exclude($this->excludes); |
|
| 82 | 82 | } |
| 83 | 83 | return $executable; |
| 84 | 84 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $result->debug($rsync->getCmd()); |
| 51 | 51 | |
| 52 | 52 | if (!$rsync->isSuccessful()) { |
| 53 | - throw new Exception('rsync failed:' . $rsync->getStdErr()); |
|
| 53 | + throw new Exception('rsync failed:'.$rsync->getStdErr()); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return $this->createStatus($target); |
@@ -227,20 +227,20 @@ |
||
| 227 | 227 | { |
| 228 | 228 | $executable = new Executable\Mysqldump($this->pathToMysqldump); |
| 229 | 229 | $executable->credentials($this->user, $this->password) |
| 230 | - ->useHost($this->host) |
|
| 231 | - ->useQuickMode($this->quick) |
|
| 232 | - ->lockTables($this->lockTables) |
|
| 233 | - ->dumpBlobsHexadecimal($this->hexBlob) |
|
| 234 | - ->useCompression($this->compress) |
|
| 235 | - ->useExtendedInsert($this->extendedInsert) |
|
| 236 | - ->dumpTables($this->tables) |
|
| 237 | - ->singleTransaction($this->singleTransaction) |
|
| 238 | - ->dumpDatabases($this->databases) |
|
| 239 | - ->ignoreTables($this->ignoreTables) |
|
| 240 | - ->produceFilePerTable($this->filePerTable) |
|
| 241 | - ->dumpNoData($this->noData) |
|
| 242 | - ->dumpStructureOnly($this->structureOnly) |
|
| 243 | - ->dumpTo($this->getDumpTarget($target)); |
|
| 230 | + ->useHost($this->host) |
|
| 231 | + ->useQuickMode($this->quick) |
|
| 232 | + ->lockTables($this->lockTables) |
|
| 233 | + ->dumpBlobsHexadecimal($this->hexBlob) |
|
| 234 | + ->useCompression($this->compress) |
|
| 235 | + ->useExtendedInsert($this->extendedInsert) |
|
| 236 | + ->dumpTables($this->tables) |
|
| 237 | + ->singleTransaction($this->singleTransaction) |
|
| 238 | + ->dumpDatabases($this->databases) |
|
| 239 | + ->ignoreTables($this->ignoreTables) |
|
| 240 | + ->produceFilePerTable($this->filePerTable) |
|
| 241 | + ->dumpNoData($this->noData) |
|
| 242 | + ->dumpStructureOnly($this->structureOnly) |
|
| 243 | + ->dumpTo($this->getDumpTarget($target)); |
|
| 244 | 244 | // if compression is active and commands can be piped |
| 245 | 245 | if ($this->isHandlingCompression($target)) { |
| 246 | 246 | $executable->compressOutput($target->getCompression()); |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $result->debug($this->getExecutable($target)->getCommandPrintable()); |
| 212 | 212 | |
| 213 | 213 | if (!$mysqldump->isSuccessful()) { |
| 214 | - throw new Exception('mysqldump failed:' . $mysqldump->getStdErr()); |
|
| 214 | + throw new Exception('mysqldump failed:'.$mysqldump->getStdErr()); |
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | return $this->createStatus($target); |
@@ -290,6 +290,6 @@ discard block |
||
| 290 | 290 | */ |
| 291 | 291 | private function getDumpTarget(Target $target) : string |
| 292 | 292 | { |
| 293 | - return $target->getPathnamePlain() . ($this->filePerTable ? '.dump' : ''); |
|
| 293 | + return $target->getPathnamePlain().($this->filePerTable ? '.dump' : ''); |
|
| 294 | 294 | } |
| 295 | 295 | } |
@@ -124,9 +124,9 @@ |
||
| 124 | 124 | { |
| 125 | 125 | $executable = new Executable\RedisCli($this->pathToRedisCli); |
| 126 | 126 | $executable->backup() |
| 127 | - ->useHost($this->host) |
|
| 128 | - ->usePort($this->port) |
|
| 129 | - ->usePassword($this->password); |
|
| 127 | + ->useHost($this->host) |
|
| 128 | + ->usePort($this->port) |
|
| 129 | + ->usePassword($this->password); |
|
| 130 | 130 | return $executable; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $saveResult = $this->runCommand($redisSave); |
| 106 | 106 | $result->debug($this->getExecutable($target)->getCommandPrintable()); |
| 107 | 107 | if (!$saveResult->isSuccessful()) { |
| 108 | - throw new Exception('redis-cli BGSAVE failed:' . $saveResult->getStdErr()); |
|
| 108 | + throw new Exception('redis-cli BGSAVE failed:'.$saveResult->getStdErr()); |
|
| 109 | 109 | } |
| 110 | 110 | // check if the save process is finished |
| 111 | 111 | $this->isDumpCreatedYet($lastBackupTimestamp, $redisLast); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | private function copyDumpToTarget(Target $target) : string |
| 193 | 193 | { |
| 194 | 194 | if (!file_exists($this->pathToRedisData)) { |
| 195 | - throw new Exception('Redis data not found at: \'' . $this->pathToRedisCli . '\''); |
|
| 195 | + throw new Exception('Redis data not found at: \''.$this->pathToRedisCli.'\''); |
|
| 196 | 196 | } |
| 197 | 197 | $targetFile = $target->getPathnamePlain(); |
| 198 | 198 | copy($this->pathToRedisData, $targetFile); |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function simulate(Target $target, Result $result) : Status |
| 29 | 29 | { |
| 30 | - $result->debug('backup data:' . PHP_EOL . $this->getExecutable($target)->getCommandPrintable()); |
|
| 30 | + $result->debug('backup data:'.PHP_EOL.$this->getExecutable($target)->getCommandPrintable()); |
|
| 31 | 31 | |
| 32 | 32 | return $this->createStatus($target); |
| 33 | 33 | } |
@@ -152,10 +152,10 @@ |
||
| 152 | 152 | |
| 153 | 153 | $executable = new Executable\Tar($this->pathToTar); |
| 154 | 154 | $executable->archiveDirectory($this->path) |
| 155 | - ->useCompression($this->compression) |
|
| 156 | - ->ignoreFailedRead($this->ignoreFailedRead) |
|
| 157 | - ->removeSourceDirectory($this->removeSourceDir) |
|
| 158 | - ->archiveTo($this->pathToArchive); |
|
| 155 | + ->useCompression($this->compression) |
|
| 156 | + ->ignoreFailedRead($this->ignoreFailedRead) |
|
| 157 | + ->removeSourceDirectory($this->removeSourceDir) |
|
| 158 | + ->archiveTo($this->pathToArchive); |
|
| 159 | 159 | return $executable; |
| 160 | 160 | } |
| 161 | 161 | |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | $result->debug($tar->getCmdPrintable()); |
| 111 | 111 | |
| 112 | 112 | if ($this->tarFailed($tar)) { |
| 113 | - throw new Exception('tar failed: ' . $tar->getStdErr()); |
|
| 113 | + throw new Exception('tar failed: '.$tar->getStdErr()); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | return $this->createStatus($target); |
@@ -262,20 +262,20 @@ |
||
| 262 | 262 | { |
| 263 | 263 | $executable = new Executable\Pgdump($this->pathToPgdump); |
| 264 | 264 | $executable->credentials($this->user, $this->password) |
| 265 | - ->useHost($this->host) |
|
| 266 | - ->usePort($this->port) |
|
| 267 | - ->dumpDatabase($this->database) |
|
| 268 | - ->dumpSchemas($this->schemas) |
|
| 269 | - ->excludeSchemas($this->excludeSchemas) |
|
| 270 | - ->dumpTables($this->tables) |
|
| 271 | - ->excludeTables($this->excludeTables) |
|
| 272 | - ->excludeTableData($this->excludeTableData) |
|
| 273 | - ->dumpSchemaOnly($this->schemaOnly) |
|
| 274 | - ->dumpDataOnly($this->dataOnly) |
|
| 275 | - ->dumpNoPrivileges($this->noPrivileges) |
|
| 276 | - ->dumpNoOwner($this->noOwner) |
|
| 277 | - ->dumpFormat($this->format) |
|
| 278 | - ->dumpTo($target->getPathnamePlain()); |
|
| 265 | + ->useHost($this->host) |
|
| 266 | + ->usePort($this->port) |
|
| 267 | + ->dumpDatabase($this->database) |
|
| 268 | + ->dumpSchemas($this->schemas) |
|
| 269 | + ->excludeSchemas($this->excludeSchemas) |
|
| 270 | + ->dumpTables($this->tables) |
|
| 271 | + ->excludeTables($this->excludeTables) |
|
| 272 | + ->excludeTableData($this->excludeTableData) |
|
| 273 | + ->dumpSchemaOnly($this->schemaOnly) |
|
| 274 | + ->dumpDataOnly($this->dataOnly) |
|
| 275 | + ->dumpNoPrivileges($this->noPrivileges) |
|
| 276 | + ->dumpNoOwner($this->noOwner) |
|
| 277 | + ->dumpFormat($this->format) |
|
| 278 | + ->dumpTo($target->getPathnamePlain()); |
|
| 279 | 279 | return $executable; |
| 280 | 280 | } |
| 281 | 281 | |
@@ -246,7 +246,7 @@ |
||
| 246 | 246 | $result->debug($pgDump->getCmdPrintable()); |
| 247 | 247 | |
| 248 | 248 | if (!$pgDump->isSuccessful()) { |
| 249 | - throw new Exception('mysqldump failed:' . $pgDump->getStdErr()); |
|
| 249 | + throw new Exception('mysqldump failed:'.$pgDump->getStdErr()); |
|
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | return $this->createStatus($target); |
@@ -140,11 +140,11 @@ |
||
| 140 | 140 | { |
| 141 | 141 | $executable = new Executable\Innobackupex($this->pathToXtraBackup); |
| 142 | 142 | $executable->useHost($this->host) |
| 143 | - ->credentials($this->user, $this->password) |
|
| 144 | - ->dumpDatabases($this->databases) |
|
| 145 | - ->including($this->include) |
|
| 146 | - ->dumpFrom($this->dataDir) |
|
| 147 | - ->dumpTo($this->getDumpDir($target)); |
|
| 143 | + ->credentials($this->user, $this->password) |
|
| 144 | + ->dumpDatabases($this->databases) |
|
| 145 | + ->including($this->include) |
|
| 146 | + ->dumpFrom($this->dataDir) |
|
| 147 | + ->dumpTo($this->getDumpDir($target)); |
|
| 148 | 148 | return $executable; |
| 149 | 149 | } |
| 150 | 150 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $result->debug($this->getExecutable($target)->getCommandPrintable()); |
| 124 | 124 | |
| 125 | 125 | if (!$innobackupex->isSuccessful()) { |
| 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); |
@@ -167,6 +167,6 @@ discard block |
||
| 167 | 167 | */ |
| 168 | 168 | public function getDumpDir(Target $target) : string |
| 169 | 169 | { |
| 170 | - return $target->getPath() . '/dump'; |
|
| 170 | + return $target->getPath().'/dump'; |
|
| 171 | 171 | } |
| 172 | 172 | } |
@@ -161,13 +161,13 @@ |
||
| 161 | 161 | { |
| 162 | 162 | $executable = new Executable\Arangodump($this->pathToArangodump); |
| 163 | 163 | $executable->useEndpoint($this->endpoint) |
| 164 | - ->credentials($this->username, $this->password) |
|
| 165 | - ->dumpDatabase($this->database) |
|
| 166 | - ->dumpCollections($this->collections) |
|
| 167 | - ->disableAuthentication($this->disableAuthentication) |
|
| 168 | - ->includeSystemCollections($this->includeSystemCollections) |
|
| 169 | - ->dumpData($this->dumpData) |
|
| 170 | - ->dumpTo($this->getDumpDir($target)); |
|
| 164 | + ->credentials($this->username, $this->password) |
|
| 165 | + ->dumpDatabase($this->database) |
|
| 166 | + ->dumpCollections($this->collections) |
|
| 167 | + ->disableAuthentication($this->disableAuthentication) |
|
| 168 | + ->includeSystemCollections($this->includeSystemCollections) |
|
| 169 | + ->dumpData($this->dumpData) |
|
| 170 | + ->dumpTo($this->getDumpDir($target)); |
|
| 171 | 171 | return $executable; |
| 172 | 172 | } |
| 173 | 173 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | $result->debug($arangodump->getCmdPrintable()); |
| 145 | 145 | |
| 146 | 146 | if (!$arangodump->isSuccessful()) { |
| 147 | - throw new Exception('arangodump failed: ' . $arangodump->getStdErr()); |
|
| 147 | + throw new Exception('arangodump failed: '.$arangodump->getStdErr()); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | return $this->createStatus($target); |
@@ -190,6 +190,6 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | public function getDumpDir(Target $target) : string |
| 192 | 192 | { |
| 193 | - return $target->getPath() . '/dump'; |
|
| 193 | + return $target->getPath().'/dump'; |
|
| 194 | 194 | } |
| 195 | 195 | } |
@@ -96,12 +96,12 @@ |
||
| 96 | 96 | ); |
| 97 | 97 | } else { |
| 98 | 98 | $executable->fromPath($this->getRsyncLocation($target)) |
| 99 | - ->toHost($this->host) |
|
| 100 | - ->toPath($this->path) |
|
| 101 | - ->toUser($this->user) |
|
| 102 | - ->compressed(!$target->shouldBeCompressed()) |
|
| 103 | - ->removeDeleted($this->delete) |
|
| 104 | - ->exclude($this->excludes); |
|
| 99 | + ->toHost($this->host) |
|
| 100 | + ->toPath($this->path) |
|
| 101 | + ->toUser($this->user) |
|
| 102 | + ->compressed(!$target->shouldBeCompressed()) |
|
| 103 | + ->removeDeleted($this->delete) |
|
| 104 | + ->exclude($this->excludes); |
|
| 105 | 105 | } |
| 106 | 106 | return $executable; |
| 107 | 107 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $result->debug($rsync->getCmd()); |
| 60 | 60 | |
| 61 | 61 | if (!$rsync->isSuccessful()) { |
| 62 | - throw new Exception('rsync failed: ' . $rsync->getStdErr()); |
|
| 62 | + throw new Exception('rsync failed: '.$rsync->getStdErr()); |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | public function simulate(Target $target, Result $result) |
| 73 | 73 | { |
| 74 | 74 | $result->debug( |
| 75 | - 'sync backup with rsync' . PHP_EOL |
|
| 75 | + 'sync backup with rsync'.PHP_EOL |
|
| 76 | 76 | . $this->getExecutable($target)->getCommandPrintable() |
| 77 | 77 | ); |
| 78 | 78 | } |