@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | // check for mandatory options |
| 74 | 74 | foreach (['user', 'secret', 'container', 'host', 'path'] as $option) { |
| 75 | 75 | if (!Arr::isSetAndNotEmptyString($config, $option)) { |
| 76 | - throw new Exception('SoftLayer ' . $option . ' is mandatory'); |
|
| 76 | + throw new Exception('SoftLayer '.$option.' is mandatory'); |
|
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | |
@@ -97,19 +97,19 @@ discard block |
||
| 97 | 97 | public function sync(Target $target, Result $result) |
| 98 | 98 | { |
| 99 | 99 | $sourcePath = $target->getPathname(); |
| 100 | - $targetPath = $this->path . $target->getFilename(); |
|
| 100 | + $targetPath = $this->path.$target->getFilename(); |
|
| 101 | 101 | |
| 102 | 102 | $options = ['adapter' => ObjectStorage_Http_Client::SOCKET, 'timeout' => 20]; |
| 103 | 103 | $objectStorage = new ObjectStorage($this->host, $this->user, $this->secret, $options); |
| 104 | 104 | |
| 105 | - $result->debug('softlayer source: ' . $sourcePath); |
|
| 106 | - $result->debug('softlayer target: ' . $targetPath); |
|
| 105 | + $result->debug('softlayer source: '.$sourcePath); |
|
| 106 | + $result->debug('softlayer target: '.$targetPath); |
|
| 107 | 107 | |
| 108 | 108 | try { |
| 109 | 109 | /** @var \ObjectStorage_Container $container */ |
| 110 | - $container = $objectStorage->with($this->container . $targetPath) |
|
| 110 | + $container = $objectStorage->with($this->container.$targetPath) |
|
| 111 | 111 | ->setLocalFile($sourcePath) |
| 112 | - ->setMeta('description', 'PHPBU Backup: ' . date('r', time())) |
|
| 112 | + ->setMeta('description', 'PHPBU Backup: '.date('r', time())) |
|
| 113 | 113 | ->setHeader('Content-Type', $target->getMimeType()); |
| 114 | 114 | $container->create(); |
| 115 | 115 | } catch (\Exception $e) { |
@@ -128,12 +128,12 @@ discard block |
||
| 128 | 128 | public function simulate(Target $target, Result $result) |
| 129 | 129 | { |
| 130 | 130 | $result->debug( |
| 131 | - 'sync backup to SoftLayer' . PHP_EOL |
|
| 132 | - . ' host: ' . $this->host . PHP_EOL |
|
| 133 | - . ' user: ' . $this->user . PHP_EOL |
|
| 134 | - . ' secret: ********' . PHP_EOL |
|
| 135 | - . ' container: ' . $this->container . PHP_EOL |
|
| 136 | - . ' location: ' . $this->path |
|
| 131 | + 'sync backup to SoftLayer'.PHP_EOL |
|
| 132 | + . ' host: '.$this->host.PHP_EOL |
|
| 133 | + . ' user: '.$this->user.PHP_EOL |
|
| 134 | + . ' secret: ********'.PHP_EOL |
|
| 135 | + . ' container: '.$this->container.PHP_EOL |
|
| 136 | + . ' location: '.$this->path |
|
| 137 | 137 | ); |
| 138 | 138 | } |
| 139 | 139 | } |
@@ -477,7 +477,7 @@ |
||
| 477 | 477 | // disable output redirection if files per table is active |
| 478 | 478 | if (!$this->filePerTable) { |
| 479 | 479 | $process->redirectOutputTo( |
| 480 | - $this->dumpPathname . (!empty($this->compression) ? '.' . $this->compression->getSuffix() : '') |
|
| 480 | + $this->dumpPathname.(!empty($this->compression) ? '.'.$this->compression->getSuffix() : '') |
|
| 481 | 481 | ); |
| 482 | 482 | } |
| 483 | 483 | } |
@@ -55,9 +55,9 @@ |
||
| 55 | 55 | public static function getClassName($name) |
| 56 | 56 | { |
| 57 | 57 | if (!isset(self::$availableCompressors[$name])) { |
| 58 | - throw new Exception('Invalid compressor: ' .$name); |
|
| 58 | + throw new Exception('Invalid compressor: '.$name); |
|
| 59 | 59 | } |
| 60 | 60 | $class = self::$availableCompressors[$name]; |
| 61 | - return '\\phpbu\\App\\Backup\\Target\\Compression\\' . $class; |
|
| 61 | + return '\\phpbu\\App\\Backup\\Target\\Compression\\'.$class; |
|
| 62 | 62 | } |
| 63 | 63 | } |
@@ -286,7 +286,7 @@ |
||
| 286 | 286 | { |
| 287 | 287 | if (!isset(self::$classMap[$type])) { |
| 288 | 288 | throw new Exception( |
| 289 | - 'invalid type, please use only \'' . implode('\', \'', array_keys(self::$classMap)) . '\'' |
|
| 289 | + 'invalid type, please use only \''.implode('\', \'', array_keys(self::$classMap)).'\'' |
|
| 290 | 290 | ); |
| 291 | 291 | } |
| 292 | 292 | } |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | protected function getAdapter($name) |
| 78 | 78 | { |
| 79 | 79 | if (!isset($this->adapters[$name])) { |
| 80 | - throw new Exception('no adapter registered with name: ' . $name); |
|
| 80 | + throw new Exception('no adapter registered with name: '.$name); |
|
| 81 | 81 | } |
| 82 | 82 | return $this->adapters[$name]; |
| 83 | 83 | } |
@@ -47,39 +47,39 @@ |
||
| 47 | 47 | public static function setDefaultSnippets() |
| 48 | 48 | { |
| 49 | 49 | self::setSnippets([ |
| 50 | - 'sBody' => 'style="font-family: Arial, Helvetica, sans-serif; ' . |
|
| 51 | - 'background-color:#343b43; ' . |
|
| 52 | - 'font-size: 15px; margin:0; ' . |
|
| 50 | + 'sBody' => 'style="font-family: Arial, Helvetica, sans-serif; '. |
|
| 51 | + 'background-color:#343b43; '. |
|
| 52 | + 'font-size: 15px; margin:0; '. |
|
| 53 | 53 | 'padding:0;"', |
| 54 | - 'sTableHeader' => 'style="width:100%; ' . |
|
| 55 | - 'font-family: Arial, Helvetica, sans-serif; ' . |
|
| 56 | - 'margin:0; color:#e6e6e6;" ' . |
|
| 54 | + 'sTableHeader' => 'style="width:100%; '. |
|
| 55 | + 'font-family: Arial, Helvetica, sans-serif; '. |
|
| 56 | + 'margin:0; color:#e6e6e6;" '. |
|
| 57 | 57 | 'align="center" cellpadding="5" cellspacing="0"', |
| 58 | - 'sTableError' => 'style="width:100%; ' . |
|
| 59 | - 'background-color:#e6e6e6; ' . |
|
| 60 | - 'margin:0 auto 15px; ' . |
|
| 61 | - 'border:1px solid #011516;" ' . |
|
| 58 | + 'sTableError' => 'style="width:100%; '. |
|
| 59 | + 'background-color:#e6e6e6; '. |
|
| 60 | + 'margin:0 auto 15px; '. |
|
| 61 | + 'border:1px solid #011516;" '. |
|
| 62 | 62 | 'align="center" cellpadding="5" cellspacing="0"', |
| 63 | - 'sTableErrorCol' => 'style="border-top: 1px solid #f6f6f6; ' . |
|
| 63 | + 'sTableErrorCol' => 'style="border-top: 1px solid #f6f6f6; '. |
|
| 64 | 64 | 'border-bottom: 1px solid #c9c9c9;"', |
| 65 | - 'sTableContent' => 'style="width:380px; ' . |
|
| 66 | - 'font-family: Arial, Helvetica, sans-serif; ' . |
|
| 67 | - 'margin:0 auto;" ' . |
|
| 65 | + 'sTableContent' => 'style="width:380px; '. |
|
| 66 | + 'font-family: Arial, Helvetica, sans-serif; '. |
|
| 67 | + 'margin:0 auto;" '. |
|
| 68 | 68 | 'align="center" cellpadding="0" cellspacing="0"', |
| 69 | 69 | 'sTableContentCol' => 'style="padding:0 10px;"', |
| 70 | - 'sTableStatus' => 'style="background-color:#%s; ' . |
|
| 71 | - 'width:100%%; ' . |
|
| 72 | - 'margin:0 auto 15px; ' . |
|
| 73 | - 'border:1px solid #011516;" ' . |
|
| 70 | + 'sTableStatus' => 'style="background-color:#%s; '. |
|
| 71 | + 'width:100%%; '. |
|
| 72 | + 'margin:0 auto 15px; '. |
|
| 73 | + 'border:1px solid #011516;" '. |
|
| 74 | 74 | 'align="center" cellpadding="10" cellspacing="0"', |
| 75 | 75 | 'sTableStatusHead' => 'style="margin:0;"', |
| 76 | 76 | 'sTableStatusText' => 'style="font-size:16px;"', |
| 77 | - 'sTableBackup' => 'style="width:100%; font-family: Arial, Helvetica, sans-serif; ' . |
|
| 78 | - 'background-color:#e6e6e6; ' . |
|
| 79 | - 'margin:0 0 15px; ' . |
|
| 80 | - 'border:1px solid #011516;" ' . |
|
| 77 | + 'sTableBackup' => 'style="width:100%; font-family: Arial, Helvetica, sans-serif; '. |
|
| 78 | + 'background-color:#e6e6e6; '. |
|
| 79 | + 'margin:0 0 15px; '. |
|
| 80 | + 'border:1px solid #011516;" '. |
|
| 81 | 81 | 'align="center" cellpadding="5" cellspacing="0" width="100%"', |
| 82 | - 'sTableBackupStatusColumn' => 'style="background-color:#%s; ' . |
|
| 82 | + 'sTableBackupStatusColumn' => 'style="background-color:#%s; '. |
|
| 83 | 83 | 'border-bottom:1px solid #747474;"', |
| 84 | 84 | 'sTableBackupStatusText' => 'style="float:right;"', |
| 85 | 85 | 'sRowHead' => 'style="border-top: 1px solid #f6f6f6; border-bottom: 1px solid #c9c9c9;"', |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | public function sync(Target $target, Result $result) |
| 53 | 53 | { |
| 54 | 54 | // silence ftp errors |
| 55 | - $old = error_reporting(0); |
|
| 55 | + $old = error_reporting(0); |
|
| 56 | 56 | if (!$ftpConnection = ftp_connect($this->host)) { |
| 57 | 57 | throw new Exception( |
| 58 | 58 | sprintf( |
@@ -57,6 +57,6 @@ |
||
| 57 | 57 | */ |
| 58 | 58 | public static function getVersionString() : string |
| 59 | 59 | { |
| 60 | - return 'phpbu ' . self::id() . ' by Sebastian Feldmann and contributors.'; |
|
| 60 | + return 'phpbu '.self::id().' by Sebastian Feldmann and contributors.'; |
|
| 61 | 61 | } |
| 62 | 62 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | public function encryptFile(string $file) : OpenSSL |
| 178 | 178 | { |
| 179 | 179 | $this->sourceFile = $file; |
| 180 | - $this->targetFile = $file . '.enc'; |
|
| 180 | + $this->targetFile = $file.'.enc'; |
|
| 181 | 181 | return $this; |
| 182 | 182 | } |
| 183 | 183 | |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | { |
| 311 | 311 | $cmd->addOption('smime'); |
| 312 | 312 | $cmd->addOption('-encrypt'); |
| 313 | - $cmd->addOption('-' . $this->algorithm); |
|
| 313 | + $cmd->addOption('-'.$this->algorithm); |
|
| 314 | 314 | $cmd->addOption('-binary'); |
| 315 | 315 | $cmd->addOption('-in', $this->sourceFile, ' '); |
| 316 | 316 | $cmd->addOption('-out', $this->targetFile, ' '); |
@@ -325,12 +325,12 @@ discard block |
||
| 325 | 325 | */ |
| 326 | 326 | protected function setPasswordOptions(Cmd $cmd) |
| 327 | 327 | { |
| 328 | - $password = 'pass:' . $this->password; |
|
| 328 | + $password = 'pass:'.$this->password; |
|
| 329 | 329 | |
| 330 | 330 | $cmd->addOption('enc'); |
| 331 | 331 | $cmd->addOption('-e'); |
| 332 | 332 | $cmd->addOptionIfNotEmpty('-a', $this->base64, false); |
| 333 | - $cmd->addOption('-' . $this->algorithm); |
|
| 333 | + $cmd->addOption('-'.$this->algorithm); |
|
| 334 | 334 | $cmd->addOption('-pass', $password, ' '); |
| 335 | 335 | $cmd->addOption('-in', $this->sourceFile, ' '); |
| 336 | 336 | $cmd->addOption('-out', $this->targetFile, ' '); |