@@ -453,8 +453,8 @@ |
||
| 453 | 453 | protected function createCommandLine() : CommandLine |
| 454 | 454 | { |
| 455 | 455 | $process = new CommandLine(); |
| 456 | - $password = $this->password ? 'PGPASSWORD=' . escapeshellarg($this->password) . ' ' : ''; |
|
| 457 | - $cmd = new Cmd($password . $this->binary); |
|
| 456 | + $password = $this->password ? 'PGPASSWORD='.escapeshellarg($this->password).' ' : ''; |
|
| 457 | + $cmd = new Cmd($password.$this->binary); |
|
| 458 | 458 | $process->addCommand($cmd); |
| 459 | 459 | |
| 460 | 460 | // always disable password prompt |
@@ -102,9 +102,9 @@ |
||
| 102 | 102 | if (!empty($this->host)) { |
| 103 | 103 | // remote user |
| 104 | 104 | if (!empty($this->user)) { |
| 105 | - $return .= $this->user . '@'; |
|
| 105 | + $return .= $this->user.'@'; |
|
| 106 | 106 | } |
| 107 | - $return .= $this->host . ':'; |
|
| 107 | + $return .= $this->host.':'; |
|
| 108 | 108 | } |
| 109 | 109 | $return .= $this->path; |
| 110 | 110 | |
@@ -422,7 +422,7 @@ |
||
| 422 | 422 | -v, --verbose Output more verbose information. |
| 423 | 423 | -V, --version Output version information and exit. |
| 424 | 424 | |
| 425 | -EOT; |
|
| 425 | +eot; |
|
| 426 | 426 | if ($this->isPhar) { |
| 427 | 427 | echo ' --version-check Check whether phpbu is the latest version.' . PHP_EOL; |
| 428 | 428 | echo ' --self-upgrade Upgrade phpbu to the latest version.' . PHP_EOL; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $ret = self::EXIT_EXCEPTION; |
| 98 | 98 | } |
| 99 | 99 | } catch (\Exception $e) { |
| 100 | - echo $e->getMessage() . PHP_EOL; |
|
| 100 | + echo $e->getMessage().PHP_EOL; |
|
| 101 | 101 | $ret = self::EXIT_EXCEPTION; |
| 102 | 102 | } |
| 103 | 103 | |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | { |
| 238 | 238 | $value = Arr::getValue($this->arguments, $arg); |
| 239 | 239 | if (!empty($value)) { |
| 240 | - $setter = 'set' . ucfirst($arg); |
|
| 240 | + $setter = 'set'.ucfirst($arg); |
|
| 241 | 241 | $configuration->{$setter}($value); |
| 242 | 242 | } |
| 243 | 243 | } |
@@ -251,13 +251,13 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | // check if upgrade is necessary |
| 253 | 253 | if (!$this->isPharOutdated($this->getLatestVersion())) { |
| 254 | - echo 'You already have the latest version of phpbu installed.' . PHP_EOL; |
|
| 254 | + echo 'You already have the latest version of phpbu installed.'.PHP_EOL; |
|
| 255 | 255 | exit(self::EXIT_SUCCESS); |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | $remoteFilename = 'http://phar.phpbu.de/phpbu.phar'; |
| 259 | 259 | $localFilename = realpath($_SERVER['argv'][0]); |
| 260 | - $tempFilename = basename($localFilename, '.phar') . '-temp.phar'; |
|
| 260 | + $tempFilename = basename($localFilename, '.phar').'-temp.phar'; |
|
| 261 | 261 | |
| 262 | 262 | echo 'Updating the phpbu PHAR ... '; |
| 263 | 263 | |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | $phar = file_get_contents($remoteFilename); |
| 266 | 266 | error_reporting($old); |
| 267 | 267 | if (!$phar) { |
| 268 | - echo ' failed' . PHP_EOL . 'Could not reach phpbu update site' . PHP_EOL; |
|
| 268 | + echo ' failed'.PHP_EOL.'Could not reach phpbu update site'.PHP_EOL; |
|
| 269 | 269 | exit(self::EXIT_EXCEPTION); |
| 270 | 270 | } |
| 271 | 271 | file_put_contents($tempFilename, $phar); |
@@ -281,11 +281,11 @@ discard block |
||
| 281 | 281 | } catch (Exception $e) { |
| 282 | 282 | // cleanup crappy phar |
| 283 | 283 | unlink($tempFilename); |
| 284 | - echo 'failed' . PHP_EOL . $e->getMessage() . PHP_EOL; |
|
| 284 | + echo 'failed'.PHP_EOL.$e->getMessage().PHP_EOL; |
|
| 285 | 285 | exit(self::EXIT_EXCEPTION); |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | - echo 'done' . PHP_EOL; |
|
| 288 | + echo 'done'.PHP_EOL; |
|
| 289 | 289 | exit(self::EXIT_SUCCESS); |
| 290 | 290 | } |
| 291 | 291 | |
@@ -298,10 +298,10 @@ discard block |
||
| 298 | 298 | |
| 299 | 299 | $latestVersion = $this->getLatestVersion(); |
| 300 | 300 | if ($this->isPharOutdated($latestVersion)) { |
| 301 | - print 'You are not using the latest version of phpbu.' . PHP_EOL |
|
| 302 | - . 'Use "phpunit --self-upgrade" to install phpbu ' . $latestVersion . PHP_EOL; |
|
| 301 | + print 'You are not using the latest version of phpbu.'.PHP_EOL |
|
| 302 | + . 'Use "phpunit --self-upgrade" to install phpbu '.$latestVersion.PHP_EOL; |
|
| 303 | 303 | } else { |
| 304 | - print 'You are using the latest version of phpbu.' . PHP_EOL; |
|
| 304 | + print 'You are using the latest version of phpbu.'.PHP_EOL; |
|
| 305 | 305 | } |
| 306 | 306 | exit(self::EXIT_SUCCESS); |
| 307 | 307 | } |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | $version = file_get_contents('https://phar.phpbu.de/latest-version-of/phpbu'); |
| 319 | 319 | error_reporting($old); |
| 320 | 320 | if (!$version) { |
| 321 | - echo 'Network-Error: Could not check latest version.' . PHP_EOL; |
|
| 321 | + echo 'Network-Error: Could not check latest version.'.PHP_EOL; |
|
| 322 | 322 | exit(self::EXIT_EXCEPTION); |
| 323 | 323 | } |
| 324 | 324 | return $version; |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | return; |
| 345 | 345 | } |
| 346 | 346 | |
| 347 | - echo Version::getVersionString() . PHP_EOL . PHP_EOL; |
|
| 347 | + echo Version::getVersionString().PHP_EOL.PHP_EOL; |
|
| 348 | 348 | $this->isVersionStringPrinted = true; |
| 349 | 349 | } |
| 350 | 350 | |
@@ -369,8 +369,8 @@ discard block |
||
| 369 | 369 | |
| 370 | 370 | EOT; |
| 371 | 371 | if ($this->isPhar) { |
| 372 | - echo ' --version-check Check whether phpbu is the latest version.' . PHP_EOL; |
|
| 373 | - echo ' --self-upgrade Upgrade phpbu to the latest version.' . PHP_EOL; |
|
| 372 | + echo ' --version-check Check whether phpbu is the latest version.'.PHP_EOL; |
|
| 373 | + echo ' --self-upgrade Upgrade phpbu to the latest version.'.PHP_EOL; |
|
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | { |
| 385 | 385 | $help = $hint ? ', use "phpbu -h" for help' : ''; |
| 386 | 386 | $this->printVersionString(); |
| 387 | - echo $message . $help . PHP_EOL; |
|
| 387 | + echo $message.$help.PHP_EOL; |
|
| 388 | 388 | exit(self::EXIT_EXCEPTION); |
| 389 | 389 | } |
| 390 | 390 | |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | public function __construct(Runner $runner = null) |
| 41 | 41 | { |
| 42 | - $this->runner = $runner ? : new Runner\Simple(); |
|
| 42 | + $this->runner = $runner ?: new Runner\Simple(); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -105,10 +105,10 @@ |
||
| 105 | 105 | $executable->useSSLCert($this->certFile); |
| 106 | 106 | } else { |
| 107 | 107 | $executable->usePassword($this->password) |
| 108 | - ->encodeBase64(true); |
|
| 108 | + ->encodeBase64(true); |
|
| 109 | 109 | } |
| 110 | 110 | $executable->useAlgorithm($this->algorithm) |
| 111 | - ->deleteUncrypted(!$this->keepUncrypted); |
|
| 111 | + ->deleteUncrypted(!$this->keepUncrypted); |
|
| 112 | 112 | return $executable; |
| 113 | 113 | } |
| 114 | 114 | } |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | $crypt = $this->execute($target); |
| 34 | 34 | $name = strtolower(get_class($this)); |
| 35 | 35 | |
| 36 | - $result->debug($name . ':' . $this->getExecutable($target)->getCommandPrintable()); |
|
| 36 | + $result->debug($name.':'.$this->getExecutable($target)->getCommandPrintable()); |
|
| 37 | 37 | |
| 38 | 38 | if (!$crypt->isSuccessful()) { |
| 39 | - throw new Exception($name . ' failed:' . PHP_EOL . $crypt->getStdErr()); |
|
| 39 | + throw new Exception($name.' failed:'.PHP_EOL.$crypt->getStdErr()); |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function simulate(Target $target, Result $result) |
| 50 | 50 | { |
| 51 | 51 | $result->debug( |
| 52 | - 'execute encryption:' . PHP_EOL . |
|
| 52 | + 'execute encryption:'.PHP_EOL. |
|
| 53 | 53 | $this->getExecutable($target)->getCommandPrintable() |
| 54 | 54 | ); |
| 55 | 55 | } |
@@ -115,12 +115,12 @@ |
||
| 115 | 115 | { |
| 116 | 116 | $executable = new Executable\Mcrypt((string)$this->pathToMcrypt); |
| 117 | 117 | $executable->useAlgorithm($this->algorithm) |
| 118 | - ->useKey($this->key) |
|
| 119 | - ->useKeyFile($this->keyFile) |
|
| 120 | - ->useConfig($this->config) |
|
| 121 | - ->useHash($this->hash) |
|
| 122 | - ->saveAt($target->getPathname()) |
|
| 123 | - ->deleteUncrypted(!$this->keepUncrypted); |
|
| 118 | + ->useKey($this->key) |
|
| 119 | + ->useKeyFile($this->keyFile) |
|
| 120 | + ->useConfig($this->config) |
|
| 121 | + ->useHash($this->hash) |
|
| 122 | + ->saveAt($target->getPathname()) |
|
| 123 | + ->deleteUncrypted(!$this->keepUncrypted); |
|
| 124 | 124 | return $executable; |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | */ |
| 114 | 114 | protected function createExecutable(Target $target) : Executable |
| 115 | 115 | { |
| 116 | - $executable = new Executable\Mcrypt((string)$this->pathToMcrypt); |
|
| 116 | + $executable = new Executable\Mcrypt((string) $this->pathToMcrypt); |
|
| 117 | 117 | $executable->useAlgorithm($this->algorithm) |
| 118 | 118 | ->useKey($this->key) |
| 119 | 119 | ->useKeyFile($this->keyFile) |
@@ -176,13 +176,13 @@ |
||
| 176 | 176 | { |
| 177 | 177 | $executable = new Executable\Mongodump($this->pathToMongodump); |
| 178 | 178 | $executable->dumpToDirectory($this->getDumpDir($target)) |
| 179 | - ->useIpv6($this->useIPv6) |
|
| 180 | - ->useHost($this->host) |
|
| 181 | - ->credentials($this->user, $this->password, $this->authenticationDatabase) |
|
| 182 | - ->dumpDatabases($this->databases) |
|
| 183 | - ->dumpCollections($this->collections) |
|
| 184 | - ->excludeCollections($this->excludeCollections) |
|
| 185 | - ->excludeCollectionsWithPrefix($this->excludeCollectionsWithPrefix); |
|
| 179 | + ->useIpv6($this->useIPv6) |
|
| 180 | + ->useHost($this->host) |
|
| 181 | + ->credentials($this->user, $this->password, $this->authenticationDatabase) |
|
| 182 | + ->dumpDatabases($this->databases) |
|
| 183 | + ->dumpCollections($this->collections) |
|
| 184 | + ->excludeCollections($this->excludeCollections) |
|
| 185 | + ->excludeCollectionsWithPrefix($this->excludeCollectionsWithPrefix); |
|
| 186 | 186 | return $executable; |
| 187 | 187 | } |
| 188 | 188 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $result->debug($mongodump->getCmdPrintable()); |
| 161 | 161 | |
| 162 | 162 | if (!$mongodump->isSuccessful()) { |
| 163 | - throw new Exception('mongodump failed: ' . $mongodump->getStdErr()); |
|
| 163 | + throw new Exception('mongodump failed: '.$mongodump->getStdErr()); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | return $this->createStatus($target); |
@@ -205,6 +205,6 @@ discard block |
||
| 205 | 205 | */ |
| 206 | 206 | public function getDumpDir(Target $target) : string |
| 207 | 207 | { |
| 208 | - return $target->getPath() . '/dump'; |
|
| 208 | + return $target->getPath().'/dump'; |
|
| 209 | 209 | } |
| 210 | 210 | } |
@@ -126,10 +126,10 @@ |
||
| 126 | 126 | { |
| 127 | 127 | $executable = new Executable\Elasticdump($this->pathToElasticdump); |
| 128 | 128 | $executable->useHost($this->host) |
| 129 | - ->credentials($this->user, $this->password) |
|
| 130 | - ->dumpIndex($this->index) |
|
| 131 | - ->dumpType($this->type) |
|
| 132 | - ->dumpTo($target->getPathnamePlain()); |
|
| 129 | + ->credentials($this->user, $this->password) |
|
| 130 | + ->dumpIndex($this->index) |
|
| 131 | + ->dumpType($this->type) |
|
| 132 | + ->dumpTo($target->getPathnamePlain()); |
|
| 133 | 133 | return $executable; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -109,7 +109,7 @@ |
||
| 109 | 109 | $result->debug($elasticdump->getCmdPrintable()); |
| 110 | 110 | |
| 111 | 111 | if (!$elasticdump->isSuccessful()) { |
| 112 | - throw new Exception('elasticdump failed: ' . $elasticdump->getStdErr()); |
|
| 112 | + throw new Exception('elasticdump failed: '.$elasticdump->getStdErr()); |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | return $this->createStatus($target); |