@@ -78,7 +78,7 @@ |
||
| 78 | 78 | */ |
| 79 | 79 | public function runCommand($command) |
| 80 | 80 | { |
| 81 | - if(!isset($this->availableCommands[$command])) { |
|
| 81 | + if (!isset($this->availableCommands[$command])) { |
|
| 82 | 82 | throw new Exception('Unknown redis-cli command'); |
| 83 | 83 | } |
| 84 | 84 | $this->command = $command; |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | public static function withTrailingSlash($string) |
| 187 | 187 | { |
| 188 | - return $string . (substr($string, -1) !== '/' ? '/' : ''); |
|
| 188 | + return $string.(substr($string, -1) !== '/' ? '/' : ''); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | public static function withLeadingSlash($string) |
| 209 | 209 | { |
| 210 | - return (substr($string, 0, 1) !== '/' ? '/' : '') . $string; |
|
| 210 | + return (substr($string, 0, 1) !== '/' ? '/' : '').$string; |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /** |
@@ -230,6 +230,6 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | public static function appendPluralS($subject, $amount) |
| 232 | 232 | { |
| 233 | - return $subject . ($amount == 1 ? '' : (substr($subject, -1) == 's' ? '\'s' : 's')); |
|
| 233 | + return $subject.($amount == 1 ? '' : (substr($subject, -1) == 's' ? '\'s' : 's')); |
|
| 234 | 234 | } |
| 235 | 235 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | 'mongodump' => [], |
| 50 | 50 | 'mysqldump' => [ |
| 51 | 51 | '/usr/local/mysql/bin', // Mac OS X |
| 52 | - '/usr/mysql/bin', // Linux |
|
| 52 | + '/usr/mysql/bin', // Linux |
|
| 53 | 53 | ], |
| 54 | 54 | 'tar' => [], |
| 55 | 55 | ]; |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | public static function detectCmdLocationInPath($cmd, $path) |
| 158 | 158 | { |
| 159 | - $command = $path . DIRECTORY_SEPARATOR . $cmd; |
|
| 159 | + $command = $path.DIRECTORY_SEPARATOR.$cmd; |
|
| 160 | 160 | $bin = self::isExecutable($command); |
| 161 | 161 | if (null === $bin) { |
| 162 | 162 | throw new RuntimeException(sprintf('wrong path specified for \'%s\': %s', $cmd, $path)); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | public static function detectCmdLocationInPaths($cmd, array $paths) |
| 193 | 193 | { |
| 194 | 194 | foreach ($paths as $path) { |
| 195 | - $command = $path . DIRECTORY_SEPARATOR . $cmd; |
|
| 195 | + $command = $path.DIRECTORY_SEPARATOR.$cmd; |
|
| 196 | 196 | $bin = self::isExecutable($command); |
| 197 | 197 | if (null !== $bin) { |
| 198 | 198 | return $bin; |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | return $path; |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | - $file = $base . DIRECTORY_SEPARATOR . $path; |
|
| 301 | + $file = $base.DIRECTORY_SEPARATOR.$path; |
|
| 302 | 302 | |
| 303 | 303 | if ($useIncludePath && !file_exists($file)) { |
| 304 | 304 | $includePathFile = stream_resolve_include_path($path); |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | |
| 332 | 332 | $styledLines = []; |
| 333 | 333 | foreach ($lines as $line) { |
| 334 | - $styledLines[] = strlen($line) ? $style . str_pad($line, $padding) . "\x1b[0m" : ''; |
|
| 334 | + $styledLines[] = strlen($line) ? $style.str_pad($line, $padding)."\x1b[0m" : ''; |
|
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | return implode(PHP_EOL, $styledLines); |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | */ |
| 347 | 347 | public static function formatWithAsterisk($buffer, $length = 75) |
| 348 | 348 | { |
| 349 | - return $buffer . str_repeat('*', $length - strlen($buffer)) . PHP_EOL; |
|
| 349 | + return $buffer.str_repeat('*', $length - strlen($buffer)).PHP_EOL; |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | /** |
@@ -360,10 +360,10 @@ discard block |
||
| 360 | 360 | if ('.' === $file || '..' === $file) { |
| 361 | 361 | continue; |
| 362 | 362 | } |
| 363 | - if (is_dir($dir . '/' . $file)) { |
|
| 364 | - self::removeDir($dir . '/' . $file); |
|
| 363 | + if (is_dir($dir.'/'.$file)) { |
|
| 364 | + self::removeDir($dir.'/'.$file); |
|
| 365 | 365 | } else { |
| 366 | - unlink($dir . '/' . $file); |
|
| 366 | + unlink($dir.'/'.$file); |
|
| 367 | 367 | } |
| 368 | 368 | } |
| 369 | 369 | rmdir($dir); |
@@ -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)->getCommandLinePrintable()); |
|
| 36 | + $result->debug($name.':'.$this->getExecutable($target)->getCommandLinePrintable()); |
|
| 37 | 37 | |
| 38 | 38 | if (!$crypt->wasSuccessful()) { |
| 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)->getCommandLinePrintable() |
| 54 | 54 | ); |
| 55 | 55 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | public function sync(Target $target, Result $result) |
| 33 | 33 | { |
| 34 | 34 | $sourcePath = $target->getPathname(); |
| 35 | - $targetPath = $this->path . $target->getFilename(); |
|
| 35 | + $targetPath = $this->path.$target->getFilename(); |
|
| 36 | 36 | |
| 37 | 37 | $s3 = S3Client::factory( |
| 38 | 38 | [ |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $result->debug($rsync->getCmd()); |
| 130 | 130 | |
| 131 | 131 | if (!$rsync->wasSuccessful()) { |
| 132 | - throw new Exception('rsync failed: ' . $rsync->getStdErr()); |
|
| 132 | + throw new Exception('rsync failed: '.$rsync->getStdErr()); |
|
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | public function simulate(Target $target, Result $result) |
| 144 | 144 | { |
| 145 | 145 | $result->debug( |
| 146 | - 'sync backup with rsync' . PHP_EOL |
|
| 146 | + 'sync backup with rsync'.PHP_EOL |
|
| 147 | 147 | . $this->getExecutable($target)->getCommandLine() |
| 148 | 148 | ); |
| 149 | 149 | } |
@@ -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 | } |
@@ -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 | } |