Release 02.01.20 — brand buttons, dev mode, ATS overrides
Standards Compliance / Secret Scanning (push) Failing after 3s
Standards Compliance / Repository Structure Validation (push) Successful in 2s
Standards Compliance / License Header Validation (push) Successful in 2s
Standards Compliance / Coding Standards Check (push) Failing after 3s
Standards Compliance / Workflow Configuration Check (push) Failing after 3s
Standards Compliance / Documentation Quality Check (push) Successful in 3s
Standards Compliance / README Completeness Check (push) Successful in 3s
Standards Compliance / Git Repository Hygiene (push) Successful in 3s
Standards Compliance / Line Length Check (push) Failing after 3s
Standards Compliance / Script Integrity Validation (push) Successful in 3s
Standards Compliance / File Naming Standards (push) Successful in 3s
Standards Compliance / Insecure Code Pattern Detection (push) Successful in 2s
Standards Compliance / Dead Code Detection (push) Successful in 4s
Standards Compliance / File Size Limits (push) Successful in 3s
Standards Compliance / Binary File Detection (push) Successful in 4s
Standards Compliance / TODO/FIXME Tracking (push) Successful in 3s
Standards Compliance / Version Consistency Check (push) Successful in 49s
Standards Compliance / Code Duplication Detection (push) Successful in 43s
Standards Compliance / Broken Link Detection (push) Successful in 3s
Standards Compliance / Code Complexity Analysis (push) Successful in 46s
Standards Compliance / API Documentation Coverage (push) Successful in 3s
Standards Compliance / Accessibility Check (push) Successful in 3s
Standards Compliance / Performance Metrics (push) Successful in 2s
Standards Compliance / Dependency Vulnerability Scanning (push) Successful in 49s
Standards Compliance / Terraform Configuration Validation (push) Successful in 6s
Update MokoOnyx Payload / update-payload (push) Successful in 3s
Repo Health / Access control (push) Failing after 2s
Repo Health / Release configuration (push) Has been skipped
Repo Health / Scripts governance (push) Has been skipped
Repo Health / Repository health (push) Has been skipped
Standards Compliance / Unused Dependencies Check (push) Successful in 53s
Standards Compliance / Enterprise Readiness Check (push) Failing after 47s
Standards Compliance / Repository Health Check (push) Failing after 49s
Standards Compliance / Compliance Summary (push) Failing after 1s
Standards Compliance / Secret Scanning (push) Failing after 3s
Standards Compliance / Repository Structure Validation (push) Successful in 2s
Standards Compliance / License Header Validation (push) Successful in 2s
Standards Compliance / Coding Standards Check (push) Failing after 3s
Standards Compliance / Workflow Configuration Check (push) Failing after 3s
Standards Compliance / Documentation Quality Check (push) Successful in 3s
Standards Compliance / README Completeness Check (push) Successful in 3s
Standards Compliance / Git Repository Hygiene (push) Successful in 3s
Standards Compliance / Line Length Check (push) Failing after 3s
Standards Compliance / Script Integrity Validation (push) Successful in 3s
Standards Compliance / File Naming Standards (push) Successful in 3s
Standards Compliance / Insecure Code Pattern Detection (push) Successful in 2s
Standards Compliance / Dead Code Detection (push) Successful in 4s
Standards Compliance / File Size Limits (push) Successful in 3s
Standards Compliance / Binary File Detection (push) Successful in 4s
Standards Compliance / TODO/FIXME Tracking (push) Successful in 3s
Standards Compliance / Version Consistency Check (push) Successful in 49s
Standards Compliance / Code Duplication Detection (push) Successful in 43s
Standards Compliance / Broken Link Detection (push) Successful in 3s
Standards Compliance / Code Complexity Analysis (push) Successful in 46s
Standards Compliance / API Documentation Coverage (push) Successful in 3s
Standards Compliance / Accessibility Check (push) Successful in 3s
Standards Compliance / Performance Metrics (push) Successful in 2s
Standards Compliance / Dependency Vulnerability Scanning (push) Successful in 49s
Standards Compliance / Terraform Configuration Validation (push) Successful in 6s
Update MokoOnyx Payload / update-payload (push) Successful in 3s
Repo Health / Access control (push) Failing after 2s
Repo Health / Release configuration (push) Has been skipped
Repo Health / Scripts governance (push) Has been skipped
Repo Health / Repository health (push) Has been skipped
Standards Compliance / Unused Dependencies Check (push) Successful in 53s
Standards Compliance / Enterprise Readiness Check (push) Failing after 47s
Standards Compliance / Repository Health Check (push) Failing after 49s
Standards Compliance / Compliance Summary (push) Failing after 1s
This commit was merged in pull request #4.
This commit is contained in:
+42
-60
@@ -210,11 +210,11 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure the active Moko template is installed and locked.
|
||||
* Ensure MokoOnyx is installed, locked, and set as default.
|
||||
*
|
||||
* Prefers MokoOnyx (successor). Falls back to MokoCassiopeia.
|
||||
* If MokoOnyx is found, lock it and unlock MokoCassiopeia.
|
||||
* If only MokoCassiopeia is found, lock it as before.
|
||||
* Always installs MokoOnyx from bundled payload if not present,
|
||||
* locks it, sets it as default site template, and unlocks
|
||||
* MokoCassiopeia so it can be uninstalled.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
@@ -224,14 +224,23 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
|
||||
{
|
||||
$db = Factory::getDbo();
|
||||
|
||||
// Check for MokoOnyx first (successor template)
|
||||
// Check whether MokoOnyx is already installed
|
||||
$query = $db->getQuery(true)
|
||||
->select([$db->quoteName('extension_id'), $db->quoteName('enabled')])
|
||||
->select($db->quoteName('extension_id'))
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokoonyx'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('template'));
|
||||
$onyx = $db->setQuery($query)->loadObject();
|
||||
|
||||
// Install from payload if missing
|
||||
if (!$onyx)
|
||||
{
|
||||
$this->installMokoOnyxFromPayload();
|
||||
|
||||
// Re-check after install
|
||||
$onyx = $db->setQuery($query)->loadObject();
|
||||
}
|
||||
|
||||
if ($onyx)
|
||||
{
|
||||
// Lock and protect MokoOnyx
|
||||
@@ -245,73 +254,49 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
|
||||
)->execute();
|
||||
|
||||
$this->setDefaultTemplate('mokoonyx', 0);
|
||||
|
||||
// Unlock MokoCassiopeia if present (allow uninstall)
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('locked') . ' = 0')
|
||||
->set($db->quoteName('protected') . ' = 0')
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokocassiopeia'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('template'))
|
||||
)->execute();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Fallback: MokoCassiopeia
|
||||
$query = $db->getQuery(true)
|
||||
->select([$db->quoteName('extension_id'), $db->quoteName('enabled')])
|
||||
->from($db->quoteName('#__extensions'))
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokocassiopeia'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('template'));
|
||||
$template = $db->setQuery($query)->loadObject();
|
||||
// Always unlock MokoCassiopeia (allow uninstall)
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('locked') . ' = 0')
|
||||
->set($db->quoteName('protected') . ' = 0')
|
||||
->where($db->quoteName('element') . ' = ' . $db->quote('mokocassiopeia'))
|
||||
->where($db->quoteName('type') . ' = ' . $db->quote('template'))
|
||||
)->execute();
|
||||
}
|
||||
|
||||
if ($template)
|
||||
{
|
||||
// Lock, protect, and set as default
|
||||
$db->setQuery(
|
||||
$db->getQuery(true)
|
||||
->update($db->quoteName('#__extensions'))
|
||||
->set($db->quoteName('enabled') . ' = 1')
|
||||
->set($db->quoteName('locked') . ' = 1')
|
||||
->set($db->quoteName('protected') . ' = 1')
|
||||
->where($db->quoteName('extension_id') . ' = '
|
||||
. (int) $template->extension_id)
|
||||
);
|
||||
$db->execute();
|
||||
|
||||
$this->setDefaultTemplate('mokocassiopeia', 0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Template not installed — install from bundled payload
|
||||
/**
|
||||
* Install MokoOnyx from the bundled payload zip.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 02.01.17
|
||||
*/
|
||||
private function installMokoOnyxFromPayload()
|
||||
{
|
||||
$pluginPath = JPATH_PLUGINS . '/system/mokowaas';
|
||||
$payloadZip = $pluginPath . '/payload/mokocassiopeia.zip';
|
||||
$payloadZip = $pluginPath . '/payload/mokoonyx.zip';
|
||||
|
||||
if (!file_exists($payloadZip))
|
||||
{
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
'MokoCassiopeia payload not found at '
|
||||
. $payloadZip,
|
||||
'MokoOnyx payload not found. Please install MokoOnyx manually from '
|
||||
. '<a href="https://git.mokoconsulting.tech/MokoConsulting/MokoOnyx/releases" target="_blank">Gitea Releases</a>.',
|
||||
'warning'
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$tmpDir = JPATH_ROOT . '/tmp/mokocassiopeia';
|
||||
$tmpDir = JPATH_ROOT . '/tmp/mokoonyx';
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
// Extract the bundled zip
|
||||
$archive = new \Joomla\Archive\Archive();
|
||||
$archive->extract($payloadZip, $tmpDir);
|
||||
|
||||
// Release zips should have templateDetails.xml at root
|
||||
// or one level deep
|
||||
$installDir = $tmpDir;
|
||||
|
||||
if (!file_exists($tmpDir . '/templateDetails.xml'))
|
||||
@@ -325,8 +310,7 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
|
||||
else
|
||||
{
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
'MokoCassiopeia: templateDetails.xml not '
|
||||
. 'found in archive.',
|
||||
'MokoOnyx: templateDetails.xml not found in archive.',
|
||||
'warning'
|
||||
);
|
||||
|
||||
@@ -338,17 +322,15 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
|
||||
|
||||
if ($installer->install($installDir))
|
||||
{
|
||||
$this->ensureMokoCassiopeia();
|
||||
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
'MokoCassiopeia installed and locked.',
|
||||
'MokoOnyx installed successfully.',
|
||||
'message'
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
'MokoCassiopeia installation failed.',
|
||||
'MokoOnyx installation from payload failed.',
|
||||
'warning'
|
||||
);
|
||||
}
|
||||
@@ -356,7 +338,7 @@ class plgSystemMokoWaaSInstallerScript implements InstallerScriptInterface
|
||||
catch (\Exception $e)
|
||||
{
|
||||
Factory::getApplication()->enqueueMessage(
|
||||
'MokoCassiopeia error: ' . $e->getMessage(),
|
||||
'MokoOnyx error: ' . $e->getMessage(),
|
||||
'warning'
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user