chore: cascade main → dev (b8a282c) [skip ci]
#72
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user