getOptions(); if (empty($options['step'])) { echo "Step is not specified.\n"; return; } if (empty($options['id'])) { echo "Upgrade ID is not specified.\n"; return; } $stepName = $options['step']; $upgradeId = $options['id']; $result = $this->runUpgradeStep($stepName, ['id' => $upgradeId]); if (!$result) { echo "false"; return; } echo "true"; } /** * @param array $params */ private function runUpgradeStep(string $stepName, array $params): bool { $app = new Application(); $app->setupSystemUser(); $upgradeManager = new UpgradeManager($app->getContainer()); try { $result = $upgradeManager->runInstallStep($stepName, $params); } catch (Exception $e) { die("Error: " . $e->getMessage()); } return $result; } }