@@ -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); |
@@ -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); |
@@ -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 | } |
@@ -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 | } |
@@ -64,14 +64,14 @@ |
||
64 | 64 | public function compress(Target $target, Result $result) |
65 | 65 | { |
66 | 66 | if (!$this->isPathValid($this->path)) { |
67 | - throw new Exception('path to compress should be valid: ' . $this->path); |
|
67 | + throw new Exception('path to compress should be valid: '.$this->path); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $res = $this->execute($target); |
71 | 71 | $result->debug($res->getCmd()); |
72 | 72 | |
73 | 73 | if (!$res->isSuccessful()) { |
74 | - throw new Exception('Failed to \'compress\' file: ' . $this->path); |
|
74 | + throw new Exception('Failed to \'compress\' file: '.$this->path); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $this->getArchiveFile($target); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | 'mongodump' => [], |
43 | 43 | 'mysqldump' => [ |
44 | 44 | '/usr/local/mysql/bin', // Mac OS X |
45 | - '/usr/mysql/bin', // Linux |
|
45 | + '/usr/mysql/bin', // Linux |
|
46 | 46 | ], |
47 | 47 | 'tar' => [], |
48 | 48 | ]; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public static function detectCmdLocationInPath(string $cmd, string $path) : string |
121 | 121 | { |
122 | - $command = $path . DIRECTORY_SEPARATOR . $cmd; |
|
122 | + $command = $path.DIRECTORY_SEPARATOR.$cmd; |
|
123 | 123 | $bin = self::isExecutable($command); |
124 | 124 | if (empty($bin)) { |
125 | 125 | throw new RuntimeException(sprintf('wrong path specified for \'%s\': %s', $cmd, $path)); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | public static function detectCmdLocationInPaths($cmd, array $paths) : string |
156 | 156 | { |
157 | 157 | foreach ($paths as $path) { |
158 | - $command = $path . DIRECTORY_SEPARATOR . $cmd; |
|
158 | + $command = $path.DIRECTORY_SEPARATOR.$cmd; |
|
159 | 159 | $bin = self::isExecutable($command); |
160 | 160 | if (null !== $bin) { |
161 | 161 | return $bin; |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | return $path; |
262 | 262 | } |
263 | 263 | |
264 | - $file = $base . DIRECTORY_SEPARATOR . $path; |
|
264 | + $file = $base.DIRECTORY_SEPARATOR.$path; |
|
265 | 265 | |
266 | 266 | if ($useIncludePath && !file_exists($file)) { |
267 | 267 | $includePathFile = stream_resolve_include_path($path); |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | |
295 | 295 | $styledLines = []; |
296 | 296 | foreach ($lines as $line) { |
297 | - $styledLines[] = strlen($line) ? $style . str_pad($line, $padding) . "\x1b[0m" : ''; |
|
297 | + $styledLines[] = strlen($line) ? $style.str_pad($line, $padding)."\x1b[0m" : ''; |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | return implode(PHP_EOL, $styledLines); |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | */ |
310 | 310 | public static function formatWithAsterisk(string $buffer, int $length = 75) : string |
311 | 311 | { |
312 | - return $buffer . str_repeat('*', $length - strlen($buffer)) . PHP_EOL; |
|
312 | + return $buffer.str_repeat('*', $length - strlen($buffer)).PHP_EOL; |
|
313 | 313 | } |
314 | 314 | |
315 | 315 | /** |
@@ -333,10 +333,10 @@ discard block |
||
333 | 333 | if ('.' === $file || '..' === $file) { |
334 | 334 | continue; |
335 | 335 | } |
336 | - if (is_dir($dir . '/' . $file)) { |
|
337 | - self::removeDir($dir . '/' . $file); |
|
336 | + if (is_dir($dir.'/'.$file)) { |
|
337 | + self::removeDir($dir.'/'.$file); |
|
338 | 338 | } else { |
339 | - unlink($dir . '/' . $file); |
|
339 | + unlink($dir.'/'.$file); |
|
340 | 340 | } |
341 | 341 | } |
342 | 342 | rmdir($dir); |
@@ -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 | } |
@@ -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 | /** |
@@ -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 |