Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
AppEraser | |
0.00% |
0 / 7 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
execute | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\App\Models\Domain; |
6 | |
7 | use PeServer\App\Models\AppConfiguration; |
8 | use PeServer\App\Models\AppDatabaseConnection; |
9 | use PeServer\Core\Log\ILogger; |
10 | use PeServer\Core\Log\ILoggerFactory; |
11 | |
12 | /** |
13 | * 所謂削除バッチ。 |
14 | * |
15 | * ふるくなったなんやかんやを削除する予定。 |
16 | */ |
17 | class AppEraser |
18 | { |
19 | #region variable |
20 | |
21 | private ILogger $logger; |
22 | |
23 | #endregion |
24 | |
25 | public function __construct( |
26 | private AppConfiguration $config, |
27 | private AppDatabaseConnection $databaseConnection, |
28 | ILoggerFactory $loggerFactory |
29 | ) { |
30 | $this->logger = $loggerFactory->createLogger($this); |
31 | } |
32 | |
33 | #region function |
34 | |
35 | public function execute(): void |
36 | { |
37 | $database = $this->databaseConnection->open(); |
38 | |
39 | $this->logger->info('未実装', $this->config); |
40 | |
41 | $this->logger->debug('キュッとする処理だけ対応'); |
42 | $database->execute('reindex'); |
43 | $database->execute('vacuum'); |
44 | $database->execute('analyze'); |
45 | } |
46 | |
47 | #endregion |
48 | } |