@@ -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 | } |
@@ -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 | } |
@@ -72,10 +72,10 @@ |
||
| 72 | 72 | $executable = new Tar($this->pathToCommand); |
| 73 | 73 | $executable->archiveDirectory($this->path); |
| 74 | 74 | $executable->archiveTo($this->getArchiveFile($target)) |
| 75 | - ->useCompression( |
|
| 76 | - $target->shouldBeCompressed() ? $target->getCompression()->getCommand() : '' |
|
| 77 | - ) |
|
| 78 | - ->removeSourceDirectory(true); |
|
| 75 | + ->useCompression( |
|
| 76 | + $target->shouldBeCompressed() ? $target->getCompression()->getCommand() : '' |
|
| 77 | + ) |
|
| 78 | + ->removeSourceDirectory(true); |
|
| 79 | 79 | return $executable; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -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 | } |
@@ -95,14 +95,14 @@ |
||
| 95 | 95 | ); |
| 96 | 96 | } else { |
| 97 | 97 | $executable->fromPath($this->getRsyncLocation($target)) |
| 98 | - ->usePassword($this->password) |
|
| 99 | - ->usePasswordFile($this->passwordFile) |
|
| 100 | - ->toHost($this->host) |
|
| 101 | - ->toPath($this->path) |
|
| 102 | - ->toUser($this->user) |
|
| 103 | - ->compressed(!$target->shouldBeCompressed()) |
|
| 104 | - ->removeDeleted($this->delete) |
|
| 105 | - ->exclude($this->excludes); |
|
| 98 | + ->usePassword($this->password) |
|
| 99 | + ->usePasswordFile($this->passwordFile) |
|
| 100 | + ->toHost($this->host) |
|
| 101 | + ->toPath($this->path) |
|
| 102 | + ->toUser($this->user) |
|
| 103 | + ->compressed(!$target->shouldBeCompressed()) |
|
| 104 | + ->removeDeleted($this->delete) |
|
| 105 | + ->exclude($this->excludes); |
|
| 106 | 106 | } |
| 107 | 107 | return $executable; |
| 108 | 108 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $this->pathElementsChanging[] = $d; |
| 180 | 180 | $foundChangingElement = true; |
| 181 | 181 | } else { |
| 182 | - $this->pathNotChanging .= DIRECTORY_SEPARATOR . $d; |
|
| 182 | + $this->pathNotChanging .= DIRECTORY_SEPARATOR.$d; |
|
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | public function getFilename(bool $plain = false) : string |
| 273 | 273 | { |
| 274 | - return $this->filename . $this->getFilenameSuffix($plain); |
|
| 274 | + return $this->filename.$this->getFilenameSuffix($plain); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /** |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | */ |
| 293 | 293 | public function getFilenameRaw($plain = false) : string |
| 294 | 294 | { |
| 295 | - return $this->filenameRaw . $this->getFilenameSuffix($plain); |
|
| 295 | + return $this->filenameRaw.$this->getFilenameSuffix($plain); |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | /** |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | */ |
| 304 | 304 | public function getFilenameSuffix($plain = false) : string |
| 305 | 305 | { |
| 306 | - return $this->getSuffixToAppend() . ($plain ? '' : $this->getCompressionSuffix() . $this->getCrypterSuffix()); |
|
| 306 | + return $this->getSuffixToAppend().($plain ? '' : $this->getCompressionSuffix().$this->getCrypterSuffix()); |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | /** |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | */ |
| 314 | 314 | public function getSuffixToAppend() : string |
| 315 | 315 | { |
| 316 | - return count($this->fileSuffixes) ? '.' . implode('.', $this->fileSuffixes) : ''; |
|
| 316 | + return count($this->fileSuffixes) ? '.'.implode('.', $this->fileSuffixes) : ''; |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | /** |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | */ |
| 324 | 324 | public function getCompressionSuffix() : string |
| 325 | 325 | { |
| 326 | - return $this->shouldBeCompressed() ? '.' . $this->compression->getSuffix() : ''; |
|
| 326 | + return $this->shouldBeCompressed() ? '.'.$this->compression->getSuffix() : ''; |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | /** |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | */ |
| 334 | 334 | public function getCrypterSuffix() : string |
| 335 | 335 | { |
| 336 | - return $this->shouldBeEncrypted() ? '.' . $this->crypter->getSuffix() : ''; |
|
| 336 | + return $this->shouldBeEncrypted() ? '.'.$this->crypter->getSuffix() : ''; |
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | /** |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | */ |
| 407 | 407 | public function getPathname(bool $plain = false) : string |
| 408 | 408 | { |
| 409 | - return $this->path . DIRECTORY_SEPARATOR . $this->getFilename($plain); |
|
| 409 | + return $this->path.DIRECTORY_SEPARATOR.$this->getFilename($plain); |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | /** |
@@ -64,11 +64,11 @@ |
||
| 64 | 64 | protected function findConfigurationInDir(string $path) : string |
| 65 | 65 | { |
| 66 | 66 | foreach ($this->defaultConfigNames as $file) { |
| 67 | - $configurationFile = $path . DIRECTORY_SEPARATOR . $file; |
|
| 67 | + $configurationFile = $path.DIRECTORY_SEPARATOR.$file; |
|
| 68 | 68 | if (file_exists($configurationFile)) { |
| 69 | 69 | return realpath($configurationFile); |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | - throw new Exception('Can\'t find configuration in directory \'' . $path . '\'.'); |
|
| 72 | + throw new Exception('Can\'t find configuration in directory \''.$path.'\'.'); |
|
| 73 | 73 | } |
| 74 | 74 | } |
@@ -368,7 +368,7 @@ |
||
| 368 | 368 | -v, --verbose Output more verbose information. |
| 369 | 369 | -V, --version Output version information and exit. |
| 370 | 370 | |
| 371 | -EOT; |
|
| 371 | +eot; |
|
| 372 | 372 | if ($this->isPhar) { |
| 373 | 373 | echo ' --version-check Check whether phpbu is up to date.' . PHP_EOL; |
| 374 | 374 | echo ' --self-update Upgrade phpbu to the latest version.' . PHP_EOL; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $ret = self::EXIT_EXCEPTION; |
| 99 | 99 | } |
| 100 | 100 | } catch (\Exception $e) { |
| 101 | - echo $e->getMessage() . PHP_EOL; |
|
| 101 | + echo $e->getMessage().PHP_EOL; |
|
| 102 | 102 | $ret = self::EXIT_EXCEPTION; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | foreach ($settingsToOverride as $arg) { |
| 220 | 220 | $value = Arr::getValue($this->arguments, $arg); |
| 221 | 221 | if (!empty($value)) { |
| 222 | - $setter = 'set' . ucfirst($arg); |
|
| 222 | + $setter = 'set'.ucfirst($arg); |
|
| 223 | 223 | $configuration->{$setter}($value); |
| 224 | 224 | } |
| 225 | 225 | } |
@@ -235,21 +235,21 @@ discard block |
||
| 235 | 235 | // check if upgrade is necessary |
| 236 | 236 | $latestVersion = $this->getLatestVersion(); |
| 237 | 237 | if (!$this->isPharOutdated($latestVersion)) { |
| 238 | - echo 'You already have the latest version of phpbu installed.' . PHP_EOL; |
|
| 238 | + echo 'You already have the latest version of phpbu installed.'.PHP_EOL; |
|
| 239 | 239 | exit(self::EXIT_SUCCESS); |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | $remoteFilename = 'http://phar.phpbu.de/phpbu.phar'; |
| 243 | 243 | $localFilename = realpath($_SERVER['argv'][0]); |
| 244 | - $tempFilename = basename($localFilename, '.phar') . '-temp.phar'; |
|
| 244 | + $tempFilename = basename($localFilename, '.phar').'-temp.phar'; |
|
| 245 | 245 | |
| 246 | - echo 'Updating the phpbu PHAR to version ' . $latestVersion . ' ... '; |
|
| 246 | + echo 'Updating the phpbu PHAR to version '.$latestVersion.' ... '; |
|
| 247 | 247 | |
| 248 | 248 | $old = error_reporting(0); |
| 249 | 249 | $phar = file_get_contents($remoteFilename); |
| 250 | 250 | error_reporting($old); |
| 251 | 251 | if (!$phar) { |
| 252 | - echo ' failed' . PHP_EOL . 'Could not reach phpbu update site' . PHP_EOL; |
|
| 252 | + echo ' failed'.PHP_EOL.'Could not reach phpbu update site'.PHP_EOL; |
|
| 253 | 253 | exit(self::EXIT_EXCEPTION); |
| 254 | 254 | } |
| 255 | 255 | file_put_contents($tempFilename, $phar); |
@@ -265,11 +265,11 @@ discard block |
||
| 265 | 265 | } catch (Exception $e) { |
| 266 | 266 | // cleanup crappy phar |
| 267 | 267 | unlink($tempFilename); |
| 268 | - echo 'failed' . PHP_EOL . $e->getMessage() . PHP_EOL; |
|
| 268 | + echo 'failed'.PHP_EOL.$e->getMessage().PHP_EOL; |
|
| 269 | 269 | exit(self::EXIT_EXCEPTION); |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | - echo 'done' . PHP_EOL; |
|
| 272 | + echo 'done'.PHP_EOL; |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | /** |
@@ -281,10 +281,10 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | $latestVersion = $this->getLatestVersion(); |
| 283 | 283 | if ($this->isPharOutdated($latestVersion)) { |
| 284 | - print 'You are not using the latest version of phpbu.' . PHP_EOL |
|
| 285 | - . 'Use "phpbu --self-update" to install phpbu ' . $latestVersion . PHP_EOL; |
|
| 284 | + print 'You are not using the latest version of phpbu.'.PHP_EOL |
|
| 285 | + . 'Use "phpbu --self-update" to install phpbu '.$latestVersion.PHP_EOL; |
|
| 286 | 286 | } else { |
| 287 | - print 'You are using the latest version of phpbu.' . PHP_EOL; |
|
| 287 | + print 'You are using the latest version of phpbu.'.PHP_EOL; |
|
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | $version = file_get_contents('https://phar.phpbu.de/latest-version-of/phpbu'); |
| 301 | 301 | error_reporting($old); |
| 302 | 302 | if (!$version) { |
| 303 | - echo 'Network-Error: Could not check latest version.' . PHP_EOL; |
|
| 303 | + echo 'Network-Error: Could not check latest version.'.PHP_EOL; |
|
| 304 | 304 | exit(self::EXIT_EXCEPTION); |
| 305 | 305 | } |
| 306 | 306 | return $version; |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | return; |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | - echo Version::getVersionString() . PHP_EOL . PHP_EOL; |
|
| 329 | + echo Version::getVersionString().PHP_EOL.PHP_EOL; |
|
| 330 | 330 | $this->isVersionStringPrinted = true; |
| 331 | 331 | } |
| 332 | 332 | |
@@ -351,8 +351,8 @@ discard block |
||
| 351 | 351 | |
| 352 | 352 | EOT; |
| 353 | 353 | if ($this->isPhar) { |
| 354 | - echo ' --version-check Check whether phpbu is up to date.' . PHP_EOL; |
|
| 355 | - echo ' --self-update Upgrade phpbu to the latest version.' . PHP_EOL; |
|
| 354 | + echo ' --version-check Check whether phpbu is up to date.'.PHP_EOL; |
|
| 355 | + echo ' --self-update Upgrade phpbu to the latest version.'.PHP_EOL; |
|
| 356 | 356 | } |
| 357 | 357 | } |
| 358 | 358 | |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | { |
| 367 | 367 | $help = $hint ? ', use "phpbu -h" for help' : ''; |
| 368 | 368 | $this->printVersionString(); |
| 369 | - echo $message . $help . PHP_EOL; |
|
| 369 | + echo $message.$help.PHP_EOL; |
|
| 370 | 370 | exit(self::EXIT_EXCEPTION); |
| 371 | 371 | } |
| 372 | 372 | |