fix(cli): fix joomla_release org, element, and isset bug #204

Merged
jmiller merged 4 commits from dev into main 2026-05-28 22:51:16 +00:00
2 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ DEFGROUP: MokoStandards.Root
INGROUP: MokoStandards
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
PATH: /README.md
VERSION: 09.04.00
VERSION: 09.03.03
BRIEF: Project overview and documentation
-->
+6 -4
View File
@@ -37,7 +37,7 @@ use MokoEnterprise\{ApiClient, AuditLogger, CliFramework, Config, PlatformAdapte
class JoomlaRelease extends CliFramework
{
private const VERSION = '04.06.00';
private const ORG = 'mokoconsulting-tech';
private const ORG = 'MokoConsulting';
private const STABILITY_TAGS = [
'development' => 'development',
@@ -75,7 +75,7 @@ class JoomlaRelease extends CliFramework
$stability = (string) $this->getArgument('--stability');
$dryRun = (bool) $this->getArgument('--dry-run');
if (!isset(self::STABILITY_TAGS[$stability])) {
if (!array_key_exists($stability, self::STABILITY_TAGS)) {
$this->log('ERROR', "Invalid stability: {$stability}. Use: " . implode(', ', array_keys(self::STABILITY_TAGS)));
return 1;
}
@@ -213,7 +213,9 @@ class JoomlaRelease extends CliFramework
// Templates don't have <element> — derive from <name>
if ($element === '') {
$element = strtolower(str_replace(' ', '', $name));
// Strip type prefix (e.g. "Template - ") before deriving element
$baseName = preg_replace('/^(Package|Plugin|Module|Component|Template|Library|File)\s*-\s*/i', '', $name);
$element = strtolower(str_replace([' ', '-'], '', $baseName));
}
$tp = '';
@@ -435,7 +437,7 @@ class JoomlaRelease extends CliFramework
$lines[] = ' <tags>';
$lines[] = " <tag>{$stability}</tag>";
$lines[] = ' </tags>';
$lines[] = " <infourl title=\"{$meta['name']}\">https://github.com/" . self::ORG . "</infourl>";
$lines[] = " <infourl title=\"{$meta['name']}\">https://git.mokoconsulting.tech/" . self::ORG . "</infourl>";
$lines[] = ' <downloads>';
$lines[] = " <downloadurl type=\"full\" format=\"zip\">{$zipUrl}</downloadurl>";
$lines[] = " <downloadurl type=\"full\" format=\"tar.gz\">{$tarUrl}</downloadurl>";