feat: add migration complete message to postflight

This commit is contained in:
2026-06-07 16:37:48 +00:00
parent eaaddd62f0
commit 833fd7b7bf
+27 -12
View File
@@ -36,8 +36,15 @@ class Pkg_MokowaasInstallerScript
{
$app = Factory::getApplication();
$app->enqueueMessage(
'<strong>MokoWaaS → MokoSuite Migration</strong><br>'
. 'Beginning migration from MokoWaaS to MokoSuite. '
. 'Downloading MokoSuite package...',
'notice'
);
// Download the MokoSuite package
$tmpPath = Factory::getApplication()->get('tmp_path', sys_get_temp_dir());
$tmpPath = $app->get('tmp_path', sys_get_temp_dir());
$zipFile = $tmpPath . '/pkg_mokosuite_migration.zip';
// Append dlid if we have one
@@ -56,7 +63,7 @@ class Pkg_MokowaasInstallerScript
if ($response->code !== 200)
{
$app->enqueueMessage(
'MokoSuite migration: Failed to download package (HTTP ' . $response->code . '). '
'<strong>Migration Failed</strong> — Could not download MokoSuite package (HTTP ' . $response->code . '). '
. 'Please install MokoSuite manually from the Joomla extension manager.',
'error'
);
@@ -69,7 +76,7 @@ class Pkg_MokowaasInstallerScript
catch (\Throwable $e)
{
$app->enqueueMessage(
'MokoSuite migration: Download failed — ' . $e->getMessage() . '. '
'<strong>Migration Failed</strong> — Download error: ' . $e->getMessage() . '. '
. 'Please install MokoSuite manually.',
'error'
);
@@ -85,17 +92,29 @@ class Pkg_MokowaasInstallerScript
if ($result)
{
// Transfer the download key to the new MokoSuite update site
$this->restoreDownloadKey();
$app->enqueueMessage(
'<strong>MokoSuite installed successfully!</strong> '
. 'Your MokoWaaS installation has been migrated to MokoSuite. '
. 'All settings, tickets, and data have been preserved.',
'<div style="padding:15px;background:#d4edda;border:1px solid #c3e6cb;border-radius:6px;margin:10px 0;">'
. '<h3 style="margin:0 0 10px 0;color:#155724;">✓ Migration Complete!</h3>'
. '<p style="margin:0;color:#155724;">'
. 'Your MokoWaaS installation has been successfully migrated to <strong>MokoSuite</strong>.<br>'
. '• All plugin settings have been preserved<br>'
. '• Database tables have been migrated<br>'
. '• Helpdesk tickets and data are intact<br>'
. '• Your license key has been transferred<br><br>'
. 'MokoWaaS extensions have been removed. Future updates will come from MokoSuite.'
. '</p></div>',
'message'
);
Log::add('MokoWaaS → MokoSuite migration completed successfully', Log::INFO, 'mokosuite');
}
else
{
$app->enqueueMessage(
'MokoSuite migration: Package install returned false. '
'<strong>Migration Warning</strong> — MokoSuite package install returned false. '
. 'Please check the Joomla installer log and install MokoSuite manually if needed.',
'warning'
);
@@ -104,21 +123,17 @@ class Pkg_MokowaasInstallerScript
catch (\Throwable $e)
{
$app->enqueueMessage(
'MokoSuite migration: Install failed — ' . $e->getMessage(),
'<strong>Migration Failed</strong> — Install error: ' . $e->getMessage(),
'error'
);
}
finally
{
// Clean up temp file
if (is_file($zipFile))
{
@unlink($zipFile);
}
}
// Transfer the download key to the new MokoSuite update site
$this->restoreDownloadKey();
}
/**