chore: cascade main → dev (b8a282c) [skip ci] #72

Merged
jmiller merged 1 commits from main into dev 2026-05-24 04:20:22 +00:00
+12
View File
@@ -155,6 +155,14 @@ function parseManifest(string $file): array
$element = (string) ($xml->element ?? '');
$group = (string) ($xml->attributes()->group ?? '');
// For packages, prefer <packagename> as the clean element (avoids pkg_pkg_ duplication)
if ($type === 'package' && $element === '') {
$packageName = (string) ($xml->packagename ?? '');
if ($packageName !== '') {
$element = $packageName;
}
}
// Fallback element detection
if ($element === '') { $element = (string) ($xml->attributes()->plugin ?? ''); }
if ($element === '') { $element = (string) ($xml->attributes()->module ?? ''); }
@@ -164,6 +172,10 @@ function parseManifest(string $file): array
$element = strtolower(basename(dirname($file)));
}
}
// Strip existing type prefix to prevent duplication (e.g. pkg_mokowaas → mokowaas)
$element = preg_replace('/^(pkg_|com_|mod_|plg_\w+_|tpl_|lib_)/', '', $element);
if ($name === '') { $name = $element; }
return compact('name', 'type', 'element', 'group');