Rename MokoSuite → MokoSuiteClient (full element rename)
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 1s
Generic: Project CI / Lint & Validate (push) Successful in 36s
Platform: moko-platform CI / Gate 1: Code Quality (push) Failing after 40s
Generic: Project CI / Tests (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (push) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: moko-platform CI / CI Summary (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 1s
Generic: Project CI / Lint & Validate (push) Successful in 36s
Platform: moko-platform CI / Gate 1: Code Quality (push) Failing after 40s
Generic: Project CI / Tests (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (push) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: moko-platform CI / CI Summary (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled
All Joomla element names, PHP classes, language files, folder structure, and manifest references renamed from mokosuite to mokosuiteclient. This repo is now the client-facing tracker for the MokoSuite platform.
This commit is contained in:
+167
-167
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* @package MokoSuite
|
||||
* @subpackage pkg_mokosuite
|
||||
* @package MokoSuiteClient
|
||||
* @subpackage pkg_mokosuiteclient
|
||||
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
|
||||
* @license GNU General Public License version 3 or later; see LICENSE
|
||||
*/
|
||||
@@ -13,7 +13,7 @@ use Joomla\CMS\Installer\InstallerAdapter;
|
||||
use Joomla\CMS\Log\Log;
|
||||
|
||||
/**
|
||||
* Package installation script for MokoSuite.
|
||||
* Package installation script for MokoSuiteClient.
|
||||
*
|
||||
* Handles migration from standalone plugin to package, enables plugins,
|
||||
* and triggers heartbeat registration on install/update.
|
||||
@@ -61,10 +61,10 @@ class Pkg_MokosuiteInstallerScript
|
||||
|
||||
public function postflight($type, $parent)
|
||||
{
|
||||
// Migrate MokoWaaS database tables to MokoSuite naming
|
||||
// Migrate MokoWaaS database tables to MokoSuiteClient naming
|
||||
$this->migrateWaasTables();
|
||||
|
||||
// Migrate params from old mokowaas extensions to mokosuite equivalents
|
||||
// Migrate params from old mokowaas extensions to mokosuiteclient equivalents
|
||||
$this->migrateWaasExtensionParams();
|
||||
|
||||
// Remove legacy extensions and migrate settings before retiring
|
||||
@@ -72,15 +72,15 @@ class Pkg_MokosuiteInstallerScript
|
||||
$this->migrateStandalonePlugins();
|
||||
$this->removeRetiredExtensions();
|
||||
|
||||
$this->enablePlugin('system', 'mokosuite');
|
||||
$this->enablePlugin('system', 'mokosuite_firewall');
|
||||
$this->enablePlugin('system', 'mokosuite_tenant');
|
||||
$this->enablePlugin('system', 'mokosuite_devtools');
|
||||
$this->enablePlugin('system', 'mokosuite_offline');
|
||||
$this->enablePlugin('webservices', 'mokosuite');
|
||||
$this->enablePlugin('task', 'mokosuitedemo');
|
||||
$this->enablePlugin('task', 'mokosuitesync');
|
||||
$this->enablePlugin('task', 'mokosuite_tickets');
|
||||
$this->enablePlugin('system', 'mokosuiteclient');
|
||||
$this->enablePlugin('system', 'mokosuiteclient_firewall');
|
||||
$this->enablePlugin('system', 'mokosuiteclient_tenant');
|
||||
$this->enablePlugin('system', 'mokosuiteclient_devtools');
|
||||
$this->enablePlugin('system', 'mokosuiteclient_offline');
|
||||
$this->enablePlugin('webservices', 'mokosuiteclient');
|
||||
$this->enablePlugin('task', 'mokosuiteclientdemo');
|
||||
$this->enablePlugin('task', 'mokosuiteclientsync');
|
||||
$this->enablePlugin('task', 'mokosuiteclient_tickets');
|
||||
|
||||
// Migrate params from core plugin to feature plugins (one-time)
|
||||
$this->migrateFeatureParams();
|
||||
@@ -100,10 +100,10 @@ class Pkg_MokosuiteInstallerScript
|
||||
// Set menu_icon params on submenu items (Joomla only renders img on level 1)
|
||||
$this->fixMenuIcons();
|
||||
|
||||
// Set up MokoSuite guided tours and unpublish Joomla defaults
|
||||
// Set up MokoSuiteClient guided tours and unpublish Joomla defaults
|
||||
$this->setupGuidedTours();
|
||||
|
||||
// Mark MokoSuite extensions as protected (prevents disable/uninstall at framework level)
|
||||
// Mark MokoSuiteClient extensions as protected (prevents disable/uninstall at framework level)
|
||||
$this->protectExtensions();
|
||||
|
||||
// Migrate all Moko update server URLs to new format
|
||||
@@ -128,8 +128,8 @@ class Pkg_MokosuiteInstallerScript
|
||||
/**
|
||||
* Remove legacy/stale extension entries and filesystem remnants.
|
||||
*
|
||||
* The old standalone plugin was named "mokosuitebrand" (plg_system_mokosuitebrand).
|
||||
* After the rewrite into the pkg_mokosuite package, the old entries and files
|
||||
* The old standalone plugin was named "mokosuiteclientbrand" (plg_system_mokosuiteclientbrand).
|
||||
* After the rewrite into the pkg_mokosuiteclient package, the old entries and files
|
||||
* may linger — especially on sites restored from old backups.
|
||||
*
|
||||
* @return void
|
||||
@@ -144,8 +144,8 @@ class Pkg_MokosuiteInstallerScript
|
||||
|
||||
// Legacy element names to remove from #__extensions
|
||||
$legacy = [
|
||||
$db->quote('mokosuitebrand'),
|
||||
$db->quote('plg_system_mokosuitebrand'),
|
||||
$db->quote('mokosuiteclientbrand'),
|
||||
$db->quote('plg_system_mokosuiteclientbrand'),
|
||||
];
|
||||
|
||||
// Delete from #__extensions
|
||||
@@ -158,7 +158,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
|
||||
// Remove legacy plugin files from the filesystem
|
||||
$legacyDirs = [
|
||||
JPATH_PLUGINS . '/system/mokosuitebrand',
|
||||
JPATH_PLUGINS . '/system/mokosuiteclientbrand',
|
||||
];
|
||||
|
||||
foreach ($legacyDirs as $dir)
|
||||
@@ -172,14 +172,14 @@ class Pkg_MokosuiteInstallerScript
|
||||
if ($count > 0)
|
||||
{
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
sprintf('Removed %d legacy MokoSuite extension(s).', $count),
|
||||
sprintf('Removed %d legacy MokoSuiteClient extension(s).', $count),
|
||||
'message'
|
||||
);
|
||||
|
||||
Log::add(
|
||||
sprintf('Cleaned up %d legacy MokoSuite extension entries', $count),
|
||||
sprintf('Cleaned up %d legacy MokoSuiteClient extension entries', $count),
|
||||
Log::INFO,
|
||||
'mokosuite'
|
||||
'mokosuiteclient'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -192,8 +192,8 @@ class Pkg_MokosuiteInstallerScript
|
||||
/**
|
||||
* Remove extensions that have been retired and merged into core.
|
||||
*
|
||||
* plg_system_mokosuite_monitor was merged into the core plugin in 02.32.00.
|
||||
* Health monitoring is now built into plg_system_mokosuite directly.
|
||||
* plg_system_mokosuiteclient_monitor was merged into the core plugin in 02.32.00.
|
||||
* Health monitoring is now built into plg_system_mokosuiteclient directly.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
@@ -201,9 +201,9 @@ class Pkg_MokosuiteInstallerScript
|
||||
*/
|
||||
private function migrateStandalonePlugins(): void
|
||||
{
|
||||
// Migrate standalone MokoJoomTOS plugin to MokoSuite Offline Bypass
|
||||
// Migrate standalone MokoJoomTOS plugin to MokoSuiteClient Offline Bypass
|
||||
$migrations = [
|
||||
['old_element' => 'mokojoomtos', 'old_folder' => 'system', 'new_element' => 'mokosuite_offline', 'new_folder' => 'system'],
|
||||
['old_element' => 'mokojoomtos', 'old_folder' => 'system', 'new_element' => 'mokosuiteclient_offline', 'new_folder' => 'system'],
|
||||
];
|
||||
|
||||
try
|
||||
@@ -294,13 +294,13 @@ class Pkg_MokosuiteInstallerScript
|
||||
Log::add(
|
||||
sprintf('Migrated %s → %s and removed old plugin', $m['old_element'], $m['new_element']),
|
||||
Log::INFO,
|
||||
'mokosuite'
|
||||
'mokosuiteclient'
|
||||
);
|
||||
}
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('Standalone plugin migration error: ' . $e->getMessage(), Log::WARNING, 'mokosuite');
|
||||
Log::add('Standalone plugin migration error: ' . $e->getMessage(), Log::WARNING, 'mokosuiteclient');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
private function removeRetiredExtensions(): void
|
||||
{
|
||||
$retired = [
|
||||
['type' => 'plugin', 'folder' => 'system', 'element' => 'mokosuite_monitor'],
|
||||
['type' => 'plugin', 'folder' => 'system', 'element' => 'mokosuiteclient_monitor'],
|
||||
['type' => 'plugin', 'folder' => 'system', 'element' => 'mokojoomtos'],
|
||||
['type' => 'plugin', 'folder' => 'system', 'element' => 'mokoatsautomation'],
|
||||
['type' => 'plugin', 'folder' => 'webservices', 'element' => 'mokodpcalendarapi'],
|
||||
@@ -403,13 +403,13 @@ class Pkg_MokosuiteInstallerScript
|
||||
Log::add(
|
||||
sprintf('Removed retired extension %s/%s (ID %d)', $ext['folder'], $ext['element'], $extId),
|
||||
Log::INFO,
|
||||
'mokosuite'
|
||||
'mokosuiteclient'
|
||||
);
|
||||
}
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('Retired extension cleanup error: ' . $e->getMessage(), Log::WARNING, 'mokosuite');
|
||||
Log::add('Retired extension cleanup error: ' . $e->getMessage(), Log::WARNING, 'mokosuiteclient');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the protected flag on all MokoSuite extensions.
|
||||
* Set the protected flag on all MokoSuiteClient extensions.
|
||||
*
|
||||
* Joomla's protected flag prevents disabling and uninstalling at the
|
||||
* framework level — no plugin-side interception needed.
|
||||
@@ -490,20 +490,20 @@ class Pkg_MokosuiteInstallerScript
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
|
||||
// All MokoSuite elements: package, system plugin, component,
|
||||
// All MokoSuiteClient elements: package, system plugin, component,
|
||||
// webservices plugins, task plugin
|
||||
$elements = [
|
||||
$db->quote('pkg_mokosuite'),
|
||||
$db->quote('mokosuite'),
|
||||
$db->quote('mokosuite_firewall'),
|
||||
$db->quote('mokosuite_tenant'),
|
||||
$db->quote('mokosuite_devtools'),
|
||||
$db->quote('mokosuite_offline'),
|
||||
$db->quote('com_mokosuite'),
|
||||
$db->quote('mod_mokosuite_cpanel'),
|
||||
$db->quote('mokosuitedemo'),
|
||||
$db->quote('mokosuitesync'),
|
||||
$db->quote('mokosuite_tickets'),
|
||||
$db->quote('pkg_mokosuiteclient'),
|
||||
$db->quote('mokosuiteclient'),
|
||||
$db->quote('mokosuiteclient_firewall'),
|
||||
$db->quote('mokosuiteclient_tenant'),
|
||||
$db->quote('mokosuiteclient_devtools'),
|
||||
$db->quote('mokosuiteclient_offline'),
|
||||
$db->quote('com_mokosuiteclient'),
|
||||
$db->quote('mod_mokosuiteclient_cpanel'),
|
||||
$db->quote('mokosuiteclientdemo'),
|
||||
$db->quote('mokosuiteclientsync'),
|
||||
$db->quote('mokosuiteclient_tickets'),
|
||||
$db->quote('mokoonyx'),
|
||||
];
|
||||
|
||||
@@ -520,7 +520,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('Error protecting MokoSuite extensions: ' . $e->getMessage(), Log::WARNING, 'jerror');
|
||||
Log::add('Error protecting MokoSuiteClient extensions: ' . $e->getMessage(), Log::WARNING, 'jerror');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -556,12 +556,12 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('Update server URL migration error: ' . $e->getMessage(), Log::WARNING, 'mokosuite');
|
||||
Log::add('Update server URL migration error: ' . $e->getMessage(), Log::WARNING, 'mokosuiteclient');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove stale and duplicate MokoSuite update site entries.
|
||||
* Remove stale and duplicate MokoSuiteClient update site entries.
|
||||
*
|
||||
* Keeps only the package-level update site pointing to the dynamic
|
||||
* MokoGitea endpoint. Removes plugin-level entries, old static URLs,
|
||||
@@ -584,7 +584,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
. " ON u.element = e.element AND u.type = e.type"
|
||||
. " SET u.extension_id = e.extension_id"
|
||||
. " WHERE u.extension_id = 0"
|
||||
. " AND u.element LIKE " . $db->quote('%mokosuite%')
|
||||
. " AND u.element LIKE " . $db->quote('%mokosuiteclient%')
|
||||
);
|
||||
$db->execute();
|
||||
}
|
||||
@@ -599,16 +599,16 @@ class Pkg_MokosuiteInstallerScript
|
||||
try
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
$dynamicUrl = 'https://git.mokoconsulting.tech/MokoConsulting/MokoSuite/updates.xml';
|
||||
$dynamicUrl = 'https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteClient/updates.xml';
|
||||
|
||||
// Find MokoSuite update sites (exclude MokoSuiteHQ and other Moko extensions)
|
||||
// Find MokoSuiteClient update sites (exclude MokoSuiteClientHQ and other Moko extensions)
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName(['update_site_id', 'location']))
|
||||
->from($db->quoteName('#__update_sites'))
|
||||
->where('(' . $db->quoteName('name') . ' LIKE ' . $db->quote('%MokoSuite%')
|
||||
. ' OR ' . $db->quoteName('location') . ' LIKE ' . $db->quote('%MokoSuite%') . ')')
|
||||
->where($db->quoteName('name') . ' NOT LIKE ' . $db->quote('%MokoSuiteHQ%'))
|
||||
->where($db->quoteName('location') . ' NOT LIKE ' . $db->quote('%MokoSuiteHQ%'));
|
||||
->where('(' . $db->quoteName('name') . ' LIKE ' . $db->quote('%MokoSuiteClient%')
|
||||
. ' OR ' . $db->quoteName('location') . ' LIKE ' . $db->quote('%MokoSuiteClient%') . ')')
|
||||
->where($db->quoteName('name') . ' NOT LIKE ' . $db->quote('%MokoSuiteClientHQ%'))
|
||||
->where($db->quoteName('location') . ' NOT LIKE ' . $db->quote('%MokoSuiteClientHQ%'));
|
||||
$db->setQuery($query);
|
||||
$sites = $db->loadObjectList();
|
||||
|
||||
@@ -660,7 +660,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
if ($count > 0)
|
||||
{
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
sprintf('Cleaned up %d stale MokoSuite update site(s).', $count),
|
||||
sprintf('Cleaned up %d stale MokoSuiteClient update site(s).', $count),
|
||||
'message'
|
||||
);
|
||||
}
|
||||
@@ -682,8 +682,8 @@ class Pkg_MokosuiteInstallerScript
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
|
||||
// Check pkg_mokosuite first, then fall back to old pkg_mokowaas
|
||||
foreach (['pkg_mokosuite', 'pkg_mokowaas'] as $element)
|
||||
// Check pkg_mokosuiteclient first, then fall back to old pkg_mokowaas
|
||||
foreach (['pkg_mokosuiteclient', 'pkg_mokowaas'] as $element)
|
||||
{
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
@@ -722,7 +722,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
->from($db->quoteName('#__update_sites', 'us'))
|
||||
->join('INNER', $db->quoteName('#__update_sites_extensions', 'use') . ' ON use.update_site_id = us.update_site_id')
|
||||
->join('INNER', $db->quoteName('#__extensions', 'e') . ' ON e.extension_id = use.extension_id')
|
||||
->where($db->quoteName('e.element') . ' = ' . $db->quote('pkg_mokosuite'))
|
||||
->where($db->quoteName('e.element') . ' = ' . $db->quote('pkg_mokosuiteclient'))
|
||||
->setLimit(1)
|
||||
);
|
||||
$siteId = (int) $db->loadResult();
|
||||
@@ -741,7 +741,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure the MokoSuite update server entry stays enabled and points
|
||||
* Ensure the MokoSuiteClient update server entry stays enabled and points
|
||||
* to the correct dynamic endpoint with the license key attached.
|
||||
*
|
||||
* Migrates legacy static URLs (raw/branch/main/updates.xml) to the
|
||||
@@ -758,25 +758,25 @@ class Pkg_MokosuiteInstallerScript
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
|
||||
$staticUrl = 'https://git.mokoconsulting.tech/MokoConsulting/MokoSuite/raw/branch/main/updates.xml';
|
||||
$staticUrl = 'https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteClient/raw/branch/main/updates.xml';
|
||||
|
||||
// Migrate old dynamic URL to static raw file URL
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__update_sites'))
|
||||
->set($db->quoteName('location') . ' = ' . $db->quote($staticUrl))
|
||||
->where('(' . $db->quoteName('name') . ' LIKE ' . $db->quote('%MokoSuite%')
|
||||
. ' OR ' . $db->quoteName('location') . ' LIKE ' . $db->quote('%MokoSuite%') . ')')
|
||||
->where('(' . $db->quoteName('name') . ' LIKE ' . $db->quote('%MokoSuiteClient%')
|
||||
. ' OR ' . $db->quoteName('location') . ' LIKE ' . $db->quote('%MokoSuiteClient%') . ')')
|
||||
->where($db->quoteName('location') . ' != ' . $db->quote($staticUrl))
|
||||
);
|
||||
$db->execute();
|
||||
|
||||
// Enable all MokoSuite update sites
|
||||
// Enable all MokoSuiteClient update sites
|
||||
$query = $db->getQuery(true)
|
||||
->update($db->quoteName('#__update_sites'))
|
||||
->set($db->quoteName('enabled') . ' = 1')
|
||||
->where('(' . $db->quoteName('name') . ' LIKE ' . $db->quote('%MokoSuite%')
|
||||
. ' OR ' . $db->quoteName('location') . ' LIKE ' . $db->quote('%MokoSuite%') . ')');
|
||||
->where('(' . $db->quoteName('name') . ' LIKE ' . $db->quote('%MokoSuiteClient%')
|
||||
. ' OR ' . $db->quoteName('location') . ' LIKE ' . $db->quote('%MokoSuiteClient%') . ')');
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
}
|
||||
@@ -787,7 +787,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
|
||||
/**
|
||||
* Send heartbeat to the MokoSuite monitoring receiver.
|
||||
* Send heartbeat to the MokoSuiteClient monitoring receiver.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
@@ -803,7 +803,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('params'))
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokosuite'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokosuiteclient'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
|
||||
->where($db->quoteName('folder') . ' = ' . $db->quote('system'));
|
||||
$coreParams = json_decode((string) $db->setQuery($query)->loadResult());
|
||||
@@ -818,7 +818,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('params'))
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokosuite_monitor'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokosuiteclient_monitor'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
|
||||
->where($db->quoteName('folder') . ' = ' . $db->quote('system'));
|
||||
$monitorParams = json_decode((string) $db->setQuery($query)->loadResult());
|
||||
@@ -827,7 +827,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
// Fall back to manifest XML default if not yet saved in params
|
||||
if (empty($baseUrl))
|
||||
{
|
||||
$manifestFile = JPATH_PLUGINS . '/system/mokosuite_monitor/mokosuite_monitor.xml';
|
||||
$manifestFile = JPATH_PLUGINS . '/system/mokosuiteclient_monitor/mokosuiteclient_monitor.xml';
|
||||
|
||||
if (is_file($manifestFile))
|
||||
{
|
||||
@@ -870,7 +870,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
|
||||
if (empty($signingKeyB64))
|
||||
{
|
||||
$manifestFile = JPATH_PLUGINS . '/system/mokosuite_monitor/mokosuite_monitor.xml';
|
||||
$manifestFile = JPATH_PLUGINS . '/system/mokosuiteclient_monitor/mokosuiteclient_monitor.xml';
|
||||
|
||||
if (is_file($manifestFile))
|
||||
{
|
||||
@@ -899,13 +899,13 @@ class Pkg_MokosuiteInstallerScript
|
||||
|
||||
if (openssl_sign($message, $signature, $privateKey, OPENSSL_ALGO_SHA256))
|
||||
{
|
||||
$headers[] = 'X-MokoSuite-Signature: ' . base64_encode($signature);
|
||||
$headers[] = 'X-MokoSuite-Timestamp: ' . $timestamp;
|
||||
$headers[] = 'X-MokoSuiteClient-Signature: ' . base64_encode($signature);
|
||||
$headers[] = 'X-MokoSuiteClient-Timestamp: ' . $timestamp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$endpoint = $baseUrl . '/api/index.php/v1/mokosuitehq/heartbeat';
|
||||
$endpoint = $baseUrl . '/api/index.php/v1/mokosuiteclienthq/heartbeat';
|
||||
|
||||
$ch = curl_init($endpoint);
|
||||
curl_setopt_array($ch, [
|
||||
@@ -924,7 +924,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
|
||||
if ($code >= 200 && $code < 300)
|
||||
{
|
||||
Factory::getApplication()->enqueueMessage('MokoSuiteHQ heartbeat: site registered', 'message');
|
||||
Factory::getApplication()->enqueueMessage('MokoSuiteClientHQ heartbeat: site registered', 'message');
|
||||
}
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
@@ -952,7 +952,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('enabled') . ' = 1')
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('module'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mod_mokosuite_cpanel'));
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mod_mokosuiteclient_cpanel'));
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
|
||||
@@ -960,7 +960,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
$query = $db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__modules'))
|
||||
->where($db->quoteName('module') . ' = ' . $db->quote('mod_mokosuite_cpanel'));
|
||||
->where($db->quoteName('module') . ' = ' . $db->quote('mod_mokosuiteclient_cpanel'));
|
||||
$db->setQuery($query);
|
||||
|
||||
if ((int) $db->loadResult() > 0)
|
||||
@@ -970,7 +970,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
|
||||
// Create the module instance on the cpanel position
|
||||
$module = (object) [
|
||||
'title' => 'MokoSuite',
|
||||
'title' => 'MokoSuiteClient',
|
||||
'note' => '',
|
||||
'content' => '',
|
||||
'ordering' => 0,
|
||||
@@ -980,7 +980,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
'publish_up' => null,
|
||||
'publish_down' => null,
|
||||
'published' => 1,
|
||||
'module' => 'mod_mokosuite_cpanel',
|
||||
'module' => 'mod_mokosuiteclient_cpanel',
|
||||
'access' => 6, // Super Users only
|
||||
'showtitle' => 0,
|
||||
'params' => '{"show_health":"1","show_plugins":"1"}',
|
||||
@@ -1003,12 +1003,12 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('CPanel module setup error: ' . $e->getMessage(), Log::WARNING, 'mokosuite');
|
||||
Log::add('CPanel module setup error: ' . $e->getMessage(), Log::WARNING, 'mokosuiteclient');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up the MokoSuite admin sidebar menu module at position 0.
|
||||
* Set up the MokoSuiteClient admin sidebar menu module at position 0.
|
||||
*/
|
||||
private function setupAdminMenuModule(): void
|
||||
{
|
||||
@@ -1022,7 +1022,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('enabled') . ' = 1')
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('module'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mod_mokosuite_menu'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mod_mokosuiteclient_menu'))
|
||||
)->execute();
|
||||
|
||||
// Check if module instance exists
|
||||
@@ -1030,7 +1030,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
$db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__modules'))
|
||||
->where($db->quoteName('module') . ' = ' . $db->quote('mod_mokosuite_menu'))
|
||||
->where($db->quoteName('module') . ' = ' . $db->quote('mod_mokosuiteclient_menu'))
|
||||
);
|
||||
|
||||
if ((int) $db->loadResult() > 0)
|
||||
@@ -1039,7 +1039,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
|
||||
$module = (object) [
|
||||
'title' => 'MokoSuite Menu',
|
||||
'title' => 'MokoSuiteClient Menu',
|
||||
'note' => '',
|
||||
'content' => '',
|
||||
'ordering' => 0,
|
||||
@@ -1049,7 +1049,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
'publish_up' => null,
|
||||
'publish_down' => null,
|
||||
'published' => 1,
|
||||
'module' => 'mod_mokosuite_menu',
|
||||
'module' => 'mod_mokosuiteclient_menu',
|
||||
'access' => 3,
|
||||
'showtitle' => 0,
|
||||
'params' => '{}',
|
||||
@@ -1066,7 +1066,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('Admin menu module setup error: ' . $e->getMessage(), Log::WARNING, 'mokosuite');
|
||||
Log::add('Admin menu module setup error: ' . $e->getMessage(), Log::WARNING, 'mokosuiteclient');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1085,7 +1085,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('enabled') . ' = 1')
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('module'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mod_mokosuite_cache'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mod_mokosuiteclient_cache'))
|
||||
)->execute();
|
||||
|
||||
// Check if module instance exists
|
||||
@@ -1093,7 +1093,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
$db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__modules'))
|
||||
->where($db->quoteName('module') . ' = ' . $db->quote('mod_mokosuite_cache'))
|
||||
->where($db->quoteName('module') . ' = ' . $db->quote('mod_mokosuiteclient_cache'))
|
||||
);
|
||||
|
||||
if ((int) $db->loadResult() > 0)
|
||||
@@ -1102,7 +1102,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
|
||||
$module = (object) [
|
||||
'title' => 'MokoSuite Cache Cleaner',
|
||||
'title' => 'MokoSuiteClient Cache Cleaner',
|
||||
'note' => '',
|
||||
'content' => '',
|
||||
'ordering' => 8,
|
||||
@@ -1112,7 +1112,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
'publish_up' => null,
|
||||
'publish_down' => null,
|
||||
'published' => 1,
|
||||
'module' => 'mod_mokosuite_cache',
|
||||
'module' => 'mod_mokosuiteclient_cache',
|
||||
'access' => 3,
|
||||
'showtitle' => 0,
|
||||
'params' => '{}',
|
||||
@@ -1130,7 +1130,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('Cache module setup error: ' . $e->getMessage(), Log::WARNING, 'mokosuite');
|
||||
Log::add('Cache module setup error: ' . $e->getMessage(), Log::WARNING, 'mokosuiteclient');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1159,7 +1159,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
'class:bolt' => 'icon-bolt',
|
||||
];
|
||||
|
||||
// Find all MokoSuite component submenu items (including those linking to other components)
|
||||
// Find all MokoSuiteClient component submenu items (including those linking to other components)
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->select(['m.id', 'm.img', 'm.params'])
|
||||
@@ -1167,7 +1167,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
->where('m.client_id = 1')
|
||||
->where('m.level >= 2')
|
||||
->where('m.parent_id IN (SELECT id FROM ' . $db->quoteName('#__menu')
|
||||
. ' WHERE client_id = 1 AND level = 1 AND link LIKE ' . $db->quote('%com_mokosuite%') . ')')
|
||||
. ' WHERE client_id = 1 AND level = 1 AND link LIKE ' . $db->quote('%com_mokosuiteclient%') . ')')
|
||||
);
|
||||
|
||||
foreach ($db->loadObjectList() as $item)
|
||||
@@ -1198,12 +1198,12 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('Menu icon fix error: ' . $e->getMessage(), Log::WARNING, 'mokosuite');
|
||||
Log::add('Menu icon fix error: ' . $e->getMessage(), Log::WARNING, 'mokosuiteclient');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpublish default Joomla guided tours and create MokoSuite tours.
|
||||
* Unpublish default Joomla guided tours and create MokoSuiteClient tours.
|
||||
* Re-enables the guided tours plugin if disabled.
|
||||
*/
|
||||
private function setupGuidedTours(): void
|
||||
@@ -1224,7 +1224,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
// Re-enable the guided tours module (shows our tours, not Joomla's)
|
||||
$db->setQuery(
|
||||
"UPDATE " . $db->quoteName('#__modules')
|
||||
. " SET published = 1, title = 'MokoSuite Tours'"
|
||||
. " SET published = 1, title = 'MokoSuiteClient Tours'"
|
||||
. " WHERE module = 'mod_guidedtours'"
|
||||
);
|
||||
$db->execute();
|
||||
@@ -1235,8 +1235,8 @@ class Pkg_MokosuiteInstallerScript
|
||||
|
||||
if (empty($overrides['MOD_GUIDEDTOURS']))
|
||||
{
|
||||
$overrides['MOD_GUIDEDTOURS'] = 'MokoSuite Tours';
|
||||
$overrides['MOD_GUIDEDTOURS_TITLE'] = 'MokoSuite Tours';
|
||||
$overrides['MOD_GUIDEDTOURS'] = 'MokoSuiteClient Tours';
|
||||
$overrides['MOD_GUIDEDTOURS_TITLE'] = 'MokoSuiteClient Tours';
|
||||
|
||||
$lines = [];
|
||||
foreach ($overrides as $k => $v)
|
||||
@@ -1254,38 +1254,38 @@ class Pkg_MokosuiteInstallerScript
|
||||
);
|
||||
$db->execute();
|
||||
|
||||
// Define MokoSuite tours
|
||||
// Define MokoSuiteClient tours
|
||||
$tours = [
|
||||
[
|
||||
'uid' => 'mokosuite-welcome',
|
||||
'title' => 'Welcome to MokoSuite',
|
||||
'desc' => 'Get started with the MokoSuite Admin Tools Suite. This tour shows you the key areas of your admin dashboard.',
|
||||
'url' => 'administrator/index.php?option=com_mokosuite',
|
||||
'uid' => 'mokosuiteclient-welcome',
|
||||
'title' => 'Welcome to MokoSuiteClient',
|
||||
'desc' => 'Get started with the MokoSuiteClient Admin Tools Suite. This tour shows you the key areas of your admin dashboard.',
|
||||
'url' => 'administrator/index.php?option=com_mokosuiteclient',
|
||||
'steps' => [
|
||||
['title' => 'MokoSuite Dashboard', 'desc' => 'This is your MokoSuite control center. You can see site info, feature plugins, WAF activity, and quick actions all in one place.', 'target' => '#mokosuite-dashboard', 'type' => 0],
|
||||
['title' => 'Site Information', 'desc' => 'The info bar shows your Joomla version, PHP version, database type, and debug/offline status at a glance.', 'target' => '.mokosuite-info-bar', 'type' => 0],
|
||||
['title' => 'Quick Actions', 'desc' => 'Use these buttons to clear cache, check updates, manage extensions, and perform common admin tasks with one click.', 'target' => '#mokosuite-btn-cache', 'type' => 0],
|
||||
['title' => 'Feature Plugins', 'desc' => 'MokoSuite features are split into toggleable plugins. Enable or disable security, tenant restrictions, developer tools, and more from here.', 'target' => '.mokosuite-plugin-grid', 'type' => 0],
|
||||
['title' => 'MokoSuite Menu', 'desc' => 'The MokoSuite sidebar menu gives you quick access to all admin tools — Helpdesk, Extensions, WAF Log, Database Tools, and more.', 'target' => '.mokosuite-admin-menu, [class*="mokosuite"]', 'type' => 0],
|
||||
['title' => 'MokoSuiteClient Dashboard', 'desc' => 'This is your MokoSuiteClient control center. You can see site info, feature plugins, WAF activity, and quick actions all in one place.', 'target' => '#mokosuiteclient-dashboard', 'type' => 0],
|
||||
['title' => 'Site Information', 'desc' => 'The info bar shows your Joomla version, PHP version, database type, and debug/offline status at a glance.', 'target' => '.mokosuiteclient-info-bar', 'type' => 0],
|
||||
['title' => 'Quick Actions', 'desc' => 'Use these buttons to clear cache, check updates, manage extensions, and perform common admin tasks with one click.', 'target' => '#mokosuiteclient-btn-cache', 'type' => 0],
|
||||
['title' => 'Feature Plugins', 'desc' => 'MokoSuiteClient features are split into toggleable plugins. Enable or disable security, tenant restrictions, developer tools, and more from here.', 'target' => '.mokosuiteclient-plugin-grid', 'type' => 0],
|
||||
['title' => 'MokoSuiteClient Menu', 'desc' => 'The MokoSuiteClient sidebar menu gives you quick access to all admin tools — Helpdesk, Extensions, WAF Log, Database Tools, and more.', 'target' => '.mokosuiteclient-admin-menu, [class*="mokosuiteclient"]', 'type' => 0],
|
||||
],
|
||||
],
|
||||
[
|
||||
'uid' => 'mokosuite-firewall',
|
||||
'title' => 'MokoSuite Firewall Setup',
|
||||
'uid' => 'mokosuiteclient-firewall',
|
||||
'title' => 'MokoSuiteClient Firewall Setup',
|
||||
'desc' => 'Configure the Web Application Firewall to protect your site from common attacks.',
|
||||
'url' => 'administrator/index.php?option=com_plugins&task=plugin.edit&filter[search]=mokosuite_firewall',
|
||||
'url' => 'administrator/index.php?option=com_plugins&task=plugin.edit&filter[search]=mokosuiteclient_firewall',
|
||||
'steps' => [
|
||||
['title' => 'Firewall Plugin', 'desc' => 'The MokoSuite Firewall provides 10 security shields including SQL injection, XSS, and malicious user agent detection.', 'target' => '', 'type' => 0],
|
||||
['title' => 'Firewall Plugin', 'desc' => 'The MokoSuiteClient Firewall provides 10 security shields including SQL injection, XSS, and malicious user agent detection.', 'target' => '', 'type' => 0],
|
||||
['title' => 'WAF Shields', 'desc' => 'Enable or disable individual WAF shields. Each shield protects against a specific attack vector. All shields are enabled by default.', 'target' => '', 'type' => 0],
|
||||
['title' => 'Security Headers', 'desc' => 'Configure HTTP security headers like X-Frame-Options, Content-Security-Policy, and HSTS to harden your site against browser-based attacks.', 'target' => '', 'type' => 0],
|
||||
['title' => 'IP Blocklist', 'desc' => 'Block specific IP addresses, CIDR ranges, or wildcard patterns. The auto-ban feature automatically blocks IPs that trigger too many WAF alerts.', 'target' => '', 'type' => 0],
|
||||
],
|
||||
],
|
||||
[
|
||||
'uid' => 'mokosuite-helpdesk',
|
||||
'title' => 'MokoSuite Helpdesk',
|
||||
'uid' => 'mokosuiteclient-helpdesk',
|
||||
'title' => 'MokoSuiteClient Helpdesk',
|
||||
'desc' => 'Learn how to manage support tickets, categories, and automation rules.',
|
||||
'url' => 'administrator/index.php?option=com_mokosuite&view=tickets',
|
||||
'url' => 'administrator/index.php?option=com_mokosuiteclient&view=tickets',
|
||||
'steps' => [
|
||||
['title' => 'Ticket List', 'desc' => 'View all support tickets with status, priority, SLA tracking, and assignment. Filter by status or search to find specific tickets.', 'target' => '', 'type' => 0],
|
||||
['title' => 'Create a Ticket', 'desc' => 'Click the New button to create a support ticket. Assign a category, priority, and optional SLA deadline.', 'target' => '', 'type' => 0],
|
||||
@@ -1293,10 +1293,10 @@ class Pkg_MokosuiteInstallerScript
|
||||
],
|
||||
],
|
||||
[
|
||||
'uid' => 'mokosuite-extensions',
|
||||
'uid' => 'mokosuiteclient-extensions',
|
||||
'title' => 'Moko Extensions Manager',
|
||||
'desc' => 'Browse and install Moko Consulting extensions from the built-in catalog.',
|
||||
'url' => 'administrator/index.php?option=com_mokosuite&view=extensions',
|
||||
'url' => 'administrator/index.php?option=com_mokosuiteclient&view=extensions',
|
||||
'steps' => [
|
||||
['title' => 'Extension Catalog', 'desc' => 'Browse all available Moko Consulting extensions. Each card shows the extension name, description, install status, and current version.', 'target' => '', 'type' => 0],
|
||||
['title' => 'Install Extensions', 'desc' => 'Click Install to add an extension from the Moko Consulting repository. Updates are handled through Joomla\'s standard update system.', 'target' => '', 'type' => 0],
|
||||
@@ -1331,7 +1331,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
'modified_by' => 0,
|
||||
'published' => 1,
|
||||
'language' => '*',
|
||||
'note' => 'MokoSuite',
|
||||
'note' => 'MokoSuiteClient',
|
||||
'access' => 3,
|
||||
'ordering' => 0,
|
||||
'autostart' => 0,
|
||||
@@ -1368,7 +1368,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('Guided tours setup error: ' . $e->getMessage(), Log::WARNING, 'mokosuite');
|
||||
Log::add('Guided tours setup error: ' . $e->getMessage(), Log::WARNING, 'mokosuiteclient');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1385,7 +1385,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
$db->getQuery(true)
|
||||
->select('COUNT(*)')
|
||||
->from($db->quoteName('#__menu'))
|
||||
->where($db->quoteName('link') . ' LIKE ' . $db->quote('%com_mokosuite&view=tickets%'))
|
||||
->where($db->quoteName('link') . ' LIKE ' . $db->quote('%com_mokosuiteclient&view=tickets%'))
|
||||
->where($db->quoteName('client_id') . ' = 0')
|
||||
);
|
||||
|
||||
@@ -1398,7 +1398,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
$db->getQuery(true)
|
||||
->select($db->quoteName('extension_id'))
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('com_mokosuite'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('com_mokosuiteclient'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('component'))
|
||||
);
|
||||
$componentId = (int) $db->loadResult();
|
||||
@@ -1420,7 +1420,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
'alias' => 'support',
|
||||
'note' => '',
|
||||
'path' => 'support',
|
||||
'link' => 'index.php?option=com_mokosuite&view=tickets',
|
||||
'link' => 'index.php?option=com_mokosuiteclient&view=tickets',
|
||||
'type' => 'component',
|
||||
'published' => 1,
|
||||
'parent_id' => $rootId,
|
||||
@@ -1455,7 +1455,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
'alias' => 'submit-ticket',
|
||||
'note' => '',
|
||||
'path' => 'support/submit-ticket',
|
||||
'link' => 'index.php?option=com_mokosuite&view=tickets&layout=submit',
|
||||
'link' => 'index.php?option=com_mokosuiteclient&view=tickets&layout=submit',
|
||||
'type' => 'component',
|
||||
'published' => 1,
|
||||
'parent_id' => $supportId,
|
||||
@@ -1480,7 +1480,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('Support menu setup error: ' . $e->getMessage(), Log::WARNING, 'mokosuite');
|
||||
Log::add('Support menu setup error: ' . $e->getMessage(), Log::WARNING, 'mokosuiteclient');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1502,7 +1502,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
$query = $db->getQuery(true)
|
||||
->select($db->quoteName('params'))
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokosuite'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokosuiteclient'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
|
||||
->where($db->quoteName('folder') . ' = ' . $db->quote('system'));
|
||||
$db->setQuery($query);
|
||||
@@ -1545,9 +1545,9 @@ class Pkg_MokosuiteInstallerScript
|
||||
$devtoolsKeys = ['dev_mode', 'reset_hits', 'delete_versions'];
|
||||
|
||||
$migrations = [
|
||||
'mokosuite_firewall' => $firewallKeys,
|
||||
'mokosuite_tenant' => $tenantKeys,
|
||||
'mokosuite_devtools' => $devtoolsKeys,
|
||||
'mokosuiteclient_firewall' => $firewallKeys,
|
||||
'mokosuiteclient_tenant' => $tenantKeys,
|
||||
'mokosuiteclient_devtools' => $devtoolsKeys,
|
||||
];
|
||||
|
||||
foreach ($migrations as $element => $keys)
|
||||
@@ -1583,19 +1583,19 @@ class Pkg_MokosuiteInstallerScript
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('params') . ' = ' . $db->quote(json_encode($core)))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokosuite'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokosuiteclient'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('plugin'))
|
||||
->where($db->quoteName('folder') . ' = ' . $db->quote('system'))
|
||||
)->execute();
|
||||
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
'MokoSuite: migrated settings to feature plugins (Firewall, Tenant, DevTools).',
|
||||
'MokoSuiteClient: migrated settings to feature plugins (Firewall, Tenant, DevTools).',
|
||||
'message'
|
||||
);
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('Feature param migration error: ' . $e->getMessage(), Log::WARNING, 'mokosuite');
|
||||
Log::add('Feature param migration error: ' . $e->getMessage(), Log::WARNING, 'mokosuiteclient');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1612,8 +1612,8 @@ class Pkg_MokosuiteInstallerScript
|
||||
$query = $db->getQuery(true)
|
||||
->select([$db->quoteName('update_site_id'), $db->quoteName('extra_query')])
|
||||
->from($db->quoteName('#__update_sites'))
|
||||
->where('(' . $db->quoteName('name') . ' LIKE ' . $db->quote('%MokoSuite%')
|
||||
. ' OR ' . $db->quoteName('location') . ' LIKE ' . $db->quote('%MokoSuite%') . ')')
|
||||
->where('(' . $db->quoteName('name') . ' LIKE ' . $db->quote('%MokoSuiteClient%')
|
||||
. ' OR ' . $db->quoteName('location') . ' LIKE ' . $db->quote('%MokoSuiteClient%') . ')')
|
||||
->setLimit(1);
|
||||
$db->setQuery($query);
|
||||
$site = $db->loadObject();
|
||||
@@ -1653,9 +1653,9 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate MokoWaaS database tables to MokoSuite naming.
|
||||
* Migrate MokoWaaS database tables to MokoSuiteClient naming.
|
||||
*
|
||||
* For each table: create new mokosuite_* table → copy data from mokowaas_* → drop old table.
|
||||
* For each table: create new mokosuiteclient_* table → copy data from mokowaas_* → drop old table.
|
||||
* Safe to run multiple times — skips tables that don't exist or are already migrated.
|
||||
*
|
||||
* @return void
|
||||
@@ -1665,15 +1665,15 @@ class Pkg_MokosuiteInstallerScript
|
||||
private function migrateWaasTables(): void
|
||||
{
|
||||
$tableMap = [
|
||||
'mokowaas_ticket_categories' => 'mokosuite_ticket_categories',
|
||||
'mokowaas_tickets' => 'mokosuite_tickets',
|
||||
'mokowaas_ticket_replies' => 'mokosuite_ticket_replies',
|
||||
'mokowaas_ticket_canned' => 'mokosuite_ticket_canned',
|
||||
'mokowaas_ticket_automation' => 'mokosuite_ticket_automation',
|
||||
'mokowaas_consent_log' => 'mokosuite_consent_log',
|
||||
'mokowaas_data_requests' => 'mokosuite_data_requests',
|
||||
'mokowaas_retention_policies' => 'mokosuite_retention_policies',
|
||||
'mokowaas_waf_log' => 'mokosuite_waf_log',
|
||||
'mokowaas_ticket_categories' => 'mokosuiteclient_ticket_categories',
|
||||
'mokowaas_tickets' => 'mokosuiteclient_tickets',
|
||||
'mokowaas_ticket_replies' => 'mokosuiteclient_ticket_replies',
|
||||
'mokowaas_ticket_canned' => 'mokosuiteclient_ticket_canned',
|
||||
'mokowaas_ticket_automation' => 'mokosuiteclient_ticket_automation',
|
||||
'mokowaas_consent_log' => 'mokosuiteclient_consent_log',
|
||||
'mokowaas_data_requests' => 'mokosuiteclient_data_requests',
|
||||
'mokowaas_retention_policies' => 'mokosuiteclient_retention_policies',
|
||||
'mokowaas_waf_log' => 'mokosuiteclient_waf_log',
|
||||
];
|
||||
|
||||
try
|
||||
@@ -1720,26 +1720,26 @@ class Pkg_MokosuiteInstallerScript
|
||||
Log::add(
|
||||
sprintf('Migrated table %s → %s (%d rows)', $oldSuffix, $newSuffix, $copied),
|
||||
Log::INFO,
|
||||
'mokosuite'
|
||||
'mokosuiteclient'
|
||||
);
|
||||
}
|
||||
|
||||
if ($migrated > 0)
|
||||
{
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
sprintf('Migrated %d MokoWaaS database table(s) to MokoSuite naming.', $migrated),
|
||||
sprintf('Migrated %d MokoWaaS database table(s) to MokoSuiteClient naming.', $migrated),
|
||||
'message'
|
||||
);
|
||||
}
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('Table migration error: ' . $e->getMessage(), Log::WARNING, 'mokosuite');
|
||||
Log::add('Table migration error: ' . $e->getMessage(), Log::WARNING, 'mokosuiteclient');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate params from old mokowaas extension entries to mokosuite equivalents.
|
||||
* Migrate params from old mokowaas extension entries to mokosuiteclient equivalents.
|
||||
*
|
||||
* Copies params where the new extension has empty/default params, then deletes
|
||||
* the old extension entries and their filesystem remnants.
|
||||
@@ -1752,22 +1752,22 @@ class Pkg_MokosuiteInstallerScript
|
||||
{
|
||||
// [old_element, old_folder, new_element, new_folder, type]
|
||||
$map = [
|
||||
['mokowaas', 'system', 'mokosuite', 'system', 'plugin'],
|
||||
['mokowaas_firewall', 'system', 'mokosuite_firewall', 'system', 'plugin'],
|
||||
['mokowaas_tenant', 'system', 'mokosuite_tenant', 'system', 'plugin'],
|
||||
['mokowaas_devtools', 'system', 'mokosuite_devtools', 'system', 'plugin'],
|
||||
['mokowaas_offline', 'system', 'mokosuite_offline', 'system', 'plugin'],
|
||||
['mokowaas_monitor', 'system', 'mokosuite_monitor', 'system', 'plugin'],
|
||||
['mokowaas', 'webservices', 'mokosuite', 'webservices', 'plugin'],
|
||||
['mokowaassync', 'task', 'mokosuitesync', 'task', 'plugin'],
|
||||
['mokowaasdemo', 'task', 'mokosuitedemo', 'task', 'plugin'],
|
||||
['mokowaas_tickets', 'task', 'mokosuite_tickets', 'task', 'plugin'],
|
||||
['com_mokowaas', '', 'com_mokosuite', '', 'component'],
|
||||
['mod_mokowaas_cpanel', '', 'mod_mokosuite_cpanel', '', 'module'],
|
||||
['mod_mokowaas_menu', '', 'mod_mokosuite_menu', '', 'module'],
|
||||
['mod_mokowaas_cache', '', 'mod_mokosuite_cache', '', 'module'],
|
||||
['mod_mokowaas_categories', '', 'mod_mokosuite_categories', '', 'module'],
|
||||
['pkg_mokowaas', '', 'pkg_mokosuite', '', 'package'],
|
||||
['mokowaas', 'system', 'mokosuiteclient', 'system', 'plugin'],
|
||||
['mokowaas_firewall', 'system', 'mokosuiteclient_firewall', 'system', 'plugin'],
|
||||
['mokowaas_tenant', 'system', 'mokosuiteclient_tenant', 'system', 'plugin'],
|
||||
['mokowaas_devtools', 'system', 'mokosuiteclient_devtools', 'system', 'plugin'],
|
||||
['mokowaas_offline', 'system', 'mokosuiteclient_offline', 'system', 'plugin'],
|
||||
['mokowaas_monitor', 'system', 'mokosuiteclient_monitor', 'system', 'plugin'],
|
||||
['mokowaas', 'webservices', 'mokosuiteclient', 'webservices', 'plugin'],
|
||||
['mokowaassync', 'task', 'mokosuiteclientsync', 'task', 'plugin'],
|
||||
['mokowaasdemo', 'task', 'mokosuiteclientdemo', 'task', 'plugin'],
|
||||
['mokowaas_tickets', 'task', 'mokosuiteclient_tickets', 'task', 'plugin'],
|
||||
['com_mokowaas', '', 'com_mokosuiteclient', '', 'component'],
|
||||
['mod_mokowaas_cpanel', '', 'mod_mokosuiteclient_cpanel', '', 'module'],
|
||||
['mod_mokowaas_menu', '', 'mod_mokosuiteclient_menu', '', 'module'],
|
||||
['mod_mokowaas_cache', '', 'mod_mokosuiteclient_cache', '', 'module'],
|
||||
['mod_mokowaas_categories', '', 'mod_mokosuiteclient_categories', '', 'module'],
|
||||
['pkg_mokowaas', '', 'pkg_mokosuiteclient', '', 'package'],
|
||||
];
|
||||
|
||||
try
|
||||
@@ -1834,7 +1834,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
Log::add(
|
||||
sprintf('Migrated params from %s to %s', $oldEl, $newEl),
|
||||
Log::INFO,
|
||||
'mokosuite'
|
||||
'mokosuiteclient'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1925,7 +1925,7 @@ class Pkg_MokosuiteInstallerScript
|
||||
}
|
||||
catch (\Throwable $e)
|
||||
{
|
||||
Log::add('Extension param migration error: ' . $e->getMessage(), Log::WARNING, 'mokosuite');
|
||||
Log::add('Extension param migration error: ' . $e->getMessage(), Log::WARNING, 'mokosuiteclient');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user