@@ -192,12 +192,12 @@ discard block |
||
192 | 192 | $info = $this->getInfoHtml($result); |
193 | 193 | $footer = $this->getFooterHtml(); |
194 | 194 | $body = '<html><body ' . TPL::getSnippet('sBody') . '>' |
195 | - . $header |
|
196 | - . $status |
|
197 | - . $errors |
|
198 | - . $info |
|
199 | - . $footer |
|
200 | - . '</body></html>'; |
|
195 | + . $header |
|
196 | + . $status |
|
197 | + . $errors |
|
198 | + . $info |
|
199 | + . $footer |
|
200 | + . '</body></html>'; |
|
201 | 201 | $state = $result->allOk() ? 'OK' : ($result->backupOkButSkipsOrFails() ? 'WARNING' : 'ERROR'); |
202 | 202 | |
203 | 203 | $this->mailer->Subject = $this->subject . ' [' . ($this->isSimulation ? 'SIMULATION' : $state) . ']'; |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | protected function getHeaderHtml() |
377 | 377 | { |
378 | 378 | return '<table ' . TPL::getSnippet('sTableContent') . '><tr><td ' . TPL::getSnippet('sTableContentCol') . '>' . |
379 | - '<table ' . TPL::getSnippet('sTableHeader') . '><tr><td>PHPBU - backup report</td></tr></table>'; |
|
379 | + '<table ' . TPL::getSnippet('sTableHeader') . '><tr><td>PHPBU - backup report</td></tr></table>'; |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | /** |
@@ -415,11 +415,11 @@ discard block |
||
415 | 415 | Str::appendPluralS('cleanup', $this->numCleanups) |
416 | 416 | ); |
417 | 417 | $html = '<table ' . sprintf(TPL::getSnippet('sTableStatus'), $color) . '>' . |
418 | - '<tr><td>' . |
|
419 | - '<span ' . TPL::getSnippet('sTableStatusText') . '>' . date('Y-m-d H:i') . '</span>' . |
|
420 | - '<h1 ' . TPL::getSnippet('sTableStatusHead') . '>' . $status . '</h1>' . |
|
421 | - '<span ' . TPL::getSnippet('sTableStatusText') . '>' . $info . '</span>' . |
|
422 | - '</td></tr>' . |
|
418 | + '<tr><td>' . |
|
419 | + '<span ' . TPL::getSnippet('sTableStatusText') . '>' . date('Y-m-d H:i') . '</span>' . |
|
420 | + '<h1 ' . TPL::getSnippet('sTableStatusHead') . '>' . $status . '</h1>' . |
|
421 | + '<span ' . TPL::getSnippet('sTableStatusText') . '>' . $info . '</span>' . |
|
422 | + '</td></tr>' . |
|
423 | 423 | '</table>'; |
424 | 424 | |
425 | 425 | return $html; |
@@ -481,65 +481,65 @@ discard block |
||
481 | 481 | $status = 'FAILURE'; |
482 | 482 | } |
483 | 483 | $html .= '<tr>' . |
484 | - '<td ' . sprintf(TPL::getSnippet('sTableBackupStatusColumn'), $color) . ' colspan="4">' . |
|
485 | - sprintf('backup <em>%s</em>', $backup->getName()) . |
|
486 | - ' <span ' . TPL::getSnippet('sTableBackupStatusText') . '>' . $status . '</span>' . |
|
487 | - '</td>' . |
|
488 | - '</tr>' . |
|
489 | - '<tr>' . |
|
490 | - '<td ' . TPL::getSnippet('sRowHead') . '> </td>' . |
|
491 | - '<td ' . TPL::getSnippet('sRowHead') . ' align="right">executed</td>' . |
|
492 | - '<td ' . TPL::getSnippet('sRowHead') . ' align="right">skipped</td>' . |
|
493 | - '<td ' . TPL::getSnippet('sRowHead') . ' align="right">failed</td>' . |
|
494 | - '</tr>'; |
|
484 | + '<td ' . sprintf(TPL::getSnippet('sTableBackupStatusColumn'), $color) . ' colspan="4">' . |
|
485 | + sprintf('backup <em>%s</em>', $backup->getName()) . |
|
486 | + ' <span ' . TPL::getSnippet('sTableBackupStatusText') . '>' . $status . '</span>' . |
|
487 | + '</td>' . |
|
488 | + '</tr>' . |
|
489 | + '<tr>' . |
|
490 | + '<td ' . TPL::getSnippet('sRowHead') . '> </td>' . |
|
491 | + '<td ' . TPL::getSnippet('sRowHead') . ' align="right">executed</td>' . |
|
492 | + '<td ' . TPL::getSnippet('sRowHead') . ' align="right">skipped</td>' . |
|
493 | + '<td ' . TPL::getSnippet('sRowHead') . ' align="right">failed</td>' . |
|
494 | + '</tr>'; |
|
495 | 495 | |
496 | 496 | $html .= '<tr>' . |
497 | - '<td ' . TPL::getSnippet('sRowCheck') . '>checks</td>' . |
|
498 | - '<td ' . TPL::getSnippet('sRowCheck') . ' align="right">' . |
|
497 | + '<td ' . TPL::getSnippet('sRowCheck') . '>checks</td>' . |
|
498 | + '<td ' . TPL::getSnippet('sRowCheck') . ' align="right">' . |
|
499 | 499 | $backup->checkCount() . ' |
500 | 500 | </td>' . |
501 | - '<td ' . TPL::getSnippet('sRowCheck') . ' align="right"> |
|
501 | + '<td ' . TPL::getSnippet('sRowCheck') . ' align="right"> |
|
502 | 502 | |
503 | 503 | </td>' . |
504 | - '<td ' . TPL::getSnippet('sRowCheck') . ' align="right">' . |
|
504 | + '<td ' . TPL::getSnippet('sRowCheck') . ' align="right">' . |
|
505 | 505 | $backup->checkCountFailed() . |
506 | - '</td>' . |
|
507 | - '</tr>' . |
|
508 | - '<tr>' . |
|
509 | - '<td ' . TPL::getSnippet('sRowCrypt') . '>crypts</td>' . |
|
510 | - '<td ' . TPL::getSnippet('sRowCrypt') . ' align="right">' . |
|
506 | + '</td>' . |
|
507 | + '</tr>' . |
|
508 | + '<tr>' . |
|
509 | + '<td ' . TPL::getSnippet('sRowCrypt') . '>crypts</td>' . |
|
510 | + '<td ' . TPL::getSnippet('sRowCrypt') . ' align="right">' . |
|
511 | 511 | $backup->cryptCount() . |
512 | - '</td>' . |
|
513 | - '<td ' . TPL::getSnippet('sRowCrypt') . ' align="right">' . |
|
512 | + '</td>' . |
|
513 | + '<td ' . TPL::getSnippet('sRowCrypt') . ' align="right">' . |
|
514 | 514 | $backup->cryptCountSkipped() . |
515 | - '</td>' . |
|
516 | - '<td ' . TPL::getSnippet('sRowCrypt') . ' align="right">' . |
|
515 | + '</td>' . |
|
516 | + '<td ' . TPL::getSnippet('sRowCrypt') . ' align="right">' . |
|
517 | 517 | $backup->cryptCountFailed() . |
518 | - '</td>' . |
|
519 | - '</tr>' . |
|
520 | - '<tr>' . |
|
521 | - '<td ' . TPL::getSnippet('sRowSync') . '>syncs</td>' . |
|
522 | - '<td ' . TPL::getSnippet('sRowSync') . ' align="right">' . |
|
518 | + '</td>' . |
|
519 | + '</tr>' . |
|
520 | + '<tr>' . |
|
521 | + '<td ' . TPL::getSnippet('sRowSync') . '>syncs</td>' . |
|
522 | + '<td ' . TPL::getSnippet('sRowSync') . ' align="right">' . |
|
523 | 523 | $backup->syncCount() . '</td>' . |
524 | - '<td ' . TPL::getSnippet('sRowSync') . ' align="right">' . |
|
524 | + '<td ' . TPL::getSnippet('sRowSync') . ' align="right">' . |
|
525 | 525 | $backup->syncCountSkipped() . |
526 | - '</td>' . |
|
527 | - '<td ' . TPL::getSnippet('sRowSync') . ' align="right">' . |
|
526 | + '</td>' . |
|
527 | + '<td ' . TPL::getSnippet('sRowSync') . ' align="right">' . |
|
528 | 528 | $backup->syncCountFailed() . |
529 | - '</td>' . |
|
530 | - '</tr>' . |
|
531 | - '<tr>' . |
|
532 | - '<td ' . TPL::getSnippet('sRowCleanup') . '>cleanups</td>' . |
|
533 | - '<td ' . TPL::getSnippet('sRowCleanup') . ' align="right">' . |
|
529 | + '</td>' . |
|
530 | + '</tr>' . |
|
531 | + '<tr>' . |
|
532 | + '<td ' . TPL::getSnippet('sRowCleanup') . '>cleanups</td>' . |
|
533 | + '<td ' . TPL::getSnippet('sRowCleanup') . ' align="right">' . |
|
534 | 534 | $backup->cleanupCount() . |
535 | - '</td>' . |
|
536 | - '<td ' . TPL::getSnippet('sRowCleanup') . ' align="right">' . |
|
535 | + '</td>' . |
|
536 | + '<td ' . TPL::getSnippet('sRowCleanup') . ' align="right">' . |
|
537 | 537 | $backup->cleanupCountSkipped() . |
538 | - '</td>' . |
|
539 | - '<td ' . TPL::getSnippet('sRowCleanup') . ' align="right">' . |
|
538 | + '</td>' . |
|
539 | + '<td ' . TPL::getSnippet('sRowCleanup') . ' align="right">' . |
|
540 | 540 | $backup->cleanupCountFailed() . |
541 | - '</td>' . |
|
542 | - '</tr>'; |
|
541 | + '</td>' . |
|
542 | + '</tr>'; |
|
543 | 543 | } |
544 | 544 | $html .= '</table>'; |
545 | 545 | } |
@@ -555,6 +555,6 @@ discard block |
||
555 | 555 | protected function getFooterHtml() |
556 | 556 | { |
557 | 557 | return '<p ' . TPL::getSnippet('sStats') . '>' . Statistics::resourceUsage() . '</p>' . |
558 | - '</td></tr></table>'; |
|
558 | + '</td></tr></table>'; |
|
559 | 559 | } |
560 | 560 | } |
@@ -198,7 +198,7 @@ |
||
198 | 198 | . $info |
199 | 199 | . $footer |
200 | 200 | . '</body></html>'; |
201 | - $state = $result->allOk() ? 'OK' : ($result->backupOkButSkipsOrFails() ? 'WARNING' : 'ERROR'); |
|
201 | + $state = $result->allOk() ? 'OK' : ($result->backupOkButSkipsOrFails() ? 'WARNING' : 'ERROR'); |
|
202 | 202 | |
203 | 203 | $this->mailer->Subject = $this->subject . ' [' . ($this->isSimulation ? 'SIMULATION' : $state) . ']'; |
204 | 204 | $this->mailer->setFrom($this->senderMail, $this->senderName); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | { |
126 | 126 | $executable = $this->createOpenSSL($target); |
127 | 127 | $executable->encryptFile($target->getPathname()) |
128 | - ->deleteSource(!$this->keepUncrypted); |
|
128 | + ->deleteSource(!$this->keepUncrypted); |
|
129 | 129 | |
130 | 130 | return $executable; |
131 | 131 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | { |
142 | 142 | $executable = $this->createOpenSSL($target); |
143 | 143 | $executable->decryptFile($target->getPathname()) |
144 | - ->deleteSource(false); |
|
144 | + ->deleteSource(false); |
|
145 | 145 | |
146 | 146 | return $executable; |
147 | 147 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $executable->useSSLCert($this->certFile); |
162 | 162 | } else { |
163 | 163 | $executable->usePassword($this->password) |
164 | - ->encodeBase64(true); |
|
164 | + ->encodeBase64(true); |
|
165 | 165 | } |
166 | 166 | $executable->useAlgorithm($this->algorithm); |
167 | 167 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | "vlucas/phpdotenv", |
40 | 40 | |
41 | 41 | ])) { |
42 | - continue; |
|
42 | + continue; |
|
43 | 43 | } |
44 | 44 | echo $package->name . ': ' . $package->version; |
45 | 45 | if (!preg_match('/^[v= ]*(([0-9]+)(\\.([0-9]+)(\\.([0-9]+)(-([0-9]+))?(-?([a-zA-Z-+][a-zA-Z0-9\\.\\-:]*)?)?)?)?)$/', $package->version)) { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | { |
103 | 103 | $executable = $this->createGpg($target); |
104 | 104 | $executable->encryptFile($target->getPathname()) |
105 | - ->deleteSource(!$this->keepUncrypted); |
|
105 | + ->deleteSource(!$this->keepUncrypted); |
|
106 | 106 | |
107 | 107 | return $executable; |
108 | 108 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | { |
118 | 118 | $executable = $this->createGpg($target); |
119 | 119 | $executable->decryptFile($target->getPathname()) |
120 | - ->deleteSource(false); |
|
120 | + ->deleteSource(false); |
|
121 | 121 | |
122 | 122 | return $executable; |
123 | 123 | } |
@@ -224,7 +224,7 @@ |
||
224 | 224 | $cmd->addOptionIfNotEmpty('-C', $this->compress, false); |
225 | 225 | |
226 | 226 | if (!empty($this->sourceFilename)) { |
227 | - $cmd->addOption('--execute', 'source '.$this->sourceFilename); |
|
227 | + $cmd->addOption('--execute', 'source ' . $this->sourceFilename); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | return $process; |
@@ -65,7 +65,7 @@ |
||
65 | 65 | ksort($files); |
66 | 66 | |
67 | 67 | while ($this->isCapacityExceeded($files)) { |
68 | - $file = array_shift($files); |
|
68 | + $file = array_shift($files); |
|
69 | 69 | if ($file === null) { |
70 | 70 | break; |
71 | 71 | } |
@@ -333,26 +333,26 @@ |
||
333 | 333 | { |
334 | 334 | $executable = new Executable\Mysqldump($this->pathToMysqldump); |
335 | 335 | $executable->credentials($this->user, $this->password) |
336 | - ->useHost($this->host) |
|
337 | - ->usePort($this->port) |
|
338 | - ->useProtocol($this->protocol) |
|
339 | - ->useQuickMode($this->quick) |
|
340 | - ->lockTables($this->lockTables) |
|
341 | - ->dumpBlobsHexadecimal($this->hexBlob) |
|
342 | - ->addGTIDStatement($this->gtidPurged) |
|
343 | - ->useSslCa($this->sslCa) |
|
344 | - ->useCompression($this->compress) |
|
345 | - ->skipExtendedInsert($this->skipExtendedInsert) |
|
346 | - ->dumpTables($this->tables) |
|
347 | - ->singleTransaction($this->singleTransaction) |
|
348 | - ->dumpDatabases($this->databases) |
|
349 | - ->ignoreTables($this->ignoreTables) |
|
350 | - ->produceFilePerTable($this->filePerTable) |
|
351 | - ->dumpNoData($this->noData) |
|
352 | - ->dumpRoutines($this->routines) |
|
353 | - ->skipTriggers($this->skipTriggers) |
|
354 | - ->dumpStructureOnly($this->structureOnly) |
|
355 | - ->dumpTo($this->getDumpTarget($target)); |
|
336 | + ->useHost($this->host) |
|
337 | + ->usePort($this->port) |
|
338 | + ->useProtocol($this->protocol) |
|
339 | + ->useQuickMode($this->quick) |
|
340 | + ->lockTables($this->lockTables) |
|
341 | + ->dumpBlobsHexadecimal($this->hexBlob) |
|
342 | + ->addGTIDStatement($this->gtidPurged) |
|
343 | + ->useSslCa($this->sslCa) |
|
344 | + ->useCompression($this->compress) |
|
345 | + ->skipExtendedInsert($this->skipExtendedInsert) |
|
346 | + ->dumpTables($this->tables) |
|
347 | + ->singleTransaction($this->singleTransaction) |
|
348 | + ->dumpDatabases($this->databases) |
|
349 | + ->ignoreTables($this->ignoreTables) |
|
350 | + ->produceFilePerTable($this->filePerTable) |
|
351 | + ->dumpNoData($this->noData) |
|
352 | + ->dumpRoutines($this->routines) |
|
353 | + ->skipTriggers($this->skipTriggers) |
|
354 | + ->dumpStructureOnly($this->structureOnly) |
|
355 | + ->dumpTo($this->getDumpTarget($target)); |
|
356 | 356 | // if compression is active and commands can be piped |
357 | 357 | if ($this->isHandlingCompression($target)) { |
358 | 358 | $executable->compressOutput($target->getCompression()); |