more granular upgrade status

This commit is contained in:
Andy Miller
2025-10-17 12:31:43 -06:00
parent fe42c3344d
commit 7e73ba9a61
6 changed files with 54 additions and 10 deletions

View File

@@ -606,8 +606,9 @@ class SafeUpgradeManager
try {
$file = $this->download($package, $timeout);
$this->setProgress('installing', 'Installing update...', null);
$this->setProgress('installing', 'Installing update...', 80);
$this->performInstall($file);
$this->setProgress('installing', 'Preparing promotion...', 92);
} catch (Throwable $e) {
$this->setProgress('error', $e->getMessage(), null);
@@ -619,13 +620,14 @@ class SafeUpgradeManager
$this->tmp = null;
}
$this->setProgress('finalizing', 'Finalizing upgrade...', 100);
$this->setProgress('finalizing', 'Finalizing upgrade...', 95);
$safeUpgrade->clearRecoveryFlag();
if ($this->recovery && method_exists($this->recovery, 'closeUpgradeWindow')) {
$this->recovery->closeUpgradeWindow();
}
$this->ensureExecutablePermissions();
$this->setProgress('finalizing', 'Finalizing upgrade...', 98);
$manifest = $this->resolveLatestManifest();
@@ -851,6 +853,7 @@ class SafeUpgradeManager
*/
protected function performInstall(string $zip): void
{
$this->setProgress('installing', 'Unpacking archive...', 82);
$folder = Installer::unZip($zip, $this->tmp . '/zip');
if ($folder === false) {
throw new RuntimeException(Installer::lastErrorMsg());
@@ -867,7 +870,9 @@ class SafeUpgradeManager
}
try {
$this->setProgress('installing', 'Running installer...', 85);
$install($zip);
$this->setProgress('installing', 'Verifying files...', 88);
} catch (Throwable $e) {
throw new RuntimeException($e->getMessage(), 0, $e);
}