Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 12 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
ManagementClearDeployProgressLogic | |
0.00% |
0 / 12 |
|
0.00% |
0 / 3 |
30 | |
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 / 10 |
|
0.00% |
0 / 1 |
12 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\App\Models\Domain\Page\Management; |
6 | |
7 | use PeServer\App\Models\AppConfiguration; |
8 | use PeServer\App\Models\AppDatabaseCache; |
9 | use PeServer\App\Models\Domain\Api\AdministratorApi\AdministratorApiDeployLogic; |
10 | use PeServer\App\Models\Domain\Page\PageLogicBase; |
11 | use PeServer\Core\IO\File; |
12 | use PeServer\Core\IO\Path; |
13 | use PeServer\Core\Mvc\LogicCallMode; |
14 | use PeServer\Core\Mvc\LogicParameter; |
15 | use PeServer\Core\Stopwatch; |
16 | |
17 | class ManagementClearDeployProgressLogic extends PageLogicBase |
18 | { |
19 | public function __construct( |
20 | LogicParameter $parameter, |
21 | private AppConfiguration $appConfig, |
22 | ) { |
23 | parent::__construct($parameter); |
24 | } |
25 | |
26 | protected function validateImpl(LogicCallMode $callMode): void |
27 | { |
28 | //NOP |
29 | } |
30 | |
31 | protected function executeImpl(LogicCallMode $callMode): void |
32 | { |
33 | $stopwatch = Stopwatch::startNew(); |
34 | |
35 | $progressFilePath = Path::combine($this->appConfig->setting->cache->deploy, AdministratorApiDeployLogic::PROGRESS_FILE_NAME); |
36 | $this->logger->debug('$progressFilePath: {0}', $progressFilePath); |
37 | $existsProgressFilePath = File::exists($progressFilePath); |
38 | if ($existsProgressFilePath) { |
39 | File::removeFile($progressFilePath); |
40 | } |
41 | |
42 | $stopwatch->stop(); |
43 | |
44 | if ($existsProgressFilePath) { |
45 | $this->addTemporaryMessage('デプロイ進捗ファイル破棄完了: ' . $stopwatch->toString()); |
46 | } else { |
47 | $this->addTemporaryMessage('デプロイ進捗ファイルなし: ' . $stopwatch->toString()); |
48 | } |
49 | } |
50 | } |