Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
ManagementBackupLogic | |
0.00% |
0 / 9 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
validateImpl | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
executeImpl | |
0.00% |
0 / 7 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\App\Models\Domain\Page\Management; |
6 | |
7 | use Exception; |
8 | use PeServer\App\Models\AppDatabaseCache; |
9 | use PeServer\App\Models\Domain\AppArchiver; |
10 | use PeServer\App\Models\Domain\Page\PageLogicBase; |
11 | use PeServer\Core\Mvc\LogicCallMode; |
12 | use PeServer\Core\Mvc\LogicParameter; |
13 | use PeServer\Core\Stopwatch; |
14 | |
15 | class ManagementBackupLogic extends PageLogicBase |
16 | { |
17 | public function __construct(LogicParameter $parameter, private AppArchiver $appArchiver) |
18 | { |
19 | parent::__construct($parameter); |
20 | } |
21 | |
22 | protected function validateImpl(LogicCallMode $callMode): void |
23 | { |
24 | //NOP |
25 | } |
26 | |
27 | protected function executeImpl(LogicCallMode $callMode): void |
28 | { |
29 | $this->appArchiver->backup(); |
30 | $this->appArchiver->rotate(); |
31 | try { |
32 | $this->appArchiver->sendLatestArchive(ManagementBackupLogic::class, false); |
33 | $this->addTemporaryMessage('バックアップ完了'); |
34 | } catch (Exception $ex) { |
35 | $this->addTemporaryMessage('バックアップ中にエラーあり'); |
36 | $this->addTemporaryMessage($ex->getMessage()); |
37 | } |
38 | } |
39 | } |