chore: Bootstrap refactoring

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2024-04-20 11:59:23 +02:00
parent 03e4a57562
commit 4e346d9f1a
99 changed files with 645 additions and 1015 deletions

View File

@@ -29,7 +29,7 @@ use JsonException;
use SP\Core\Application;
use SP\Domain\Core\Exceptions\SPException;
use SP\Domain\Core\Exceptions\ValidationException;
use SP\Domain\Persistence\Ports\UpgradeDatabaseService;
use SP\Domain\Persistence\Ports\UpgradeServiceDatabaseService;
use SP\Domain\Upgrade\Services\UpgradeAppService;
use SP\Domain\Upgrade\Services\UpgradeDatabaseService;
use SP\Domain\Upgrade\Services\UpgradeException;
@@ -48,14 +48,14 @@ final class UpgradeController extends ControllerBase
{
use JsonTrait;
private UpgradeDatabaseService $upgradeDatabaseService;
private UpgradeAppService $upgradeAppService;
private UpgradeServiceDatabaseService $upgradeDatabaseService;
private UpgradeAppService $upgradeAppService;
public function __construct(
Application $application,
WebControllerHelper $webControllerHelper,
UpgradeDatabaseService $upgradeDatabaseService,
UpgradeAppService $upgradeAppService
Application $application,
WebControllerHelper $webControllerHelper,
UpgradeServiceDatabaseService $upgradeDatabaseService,
UpgradeAppService $upgradeAppService
) {
parent::__construct($application, $webControllerHelper);
@@ -114,7 +114,7 @@ final class UpgradeController extends ControllerBase
$dbVersion = $this->configData->getDatabaseVersion();
$dbVersion = empty($dbVersion) ? '0.0' : $dbVersion;
if (UpgradeDatabaseService::needsUpgrade($dbVersion)) {
if (UpgradeServiceDatabaseService::needsUpgrade($dbVersion)) {
$this->upgradeDatabaseService->upgrade($dbVersion, $this->configData);
}
}