sort modules by name and version
This commit is contained in:
parent
154506c0bf
commit
d55df97608
1 changed files with 5 additions and 4 deletions
|
@ -222,11 +222,12 @@ class libPackman
|
||||||
|
|
||||||
protected static function sort($modules)
|
protected static function sort($modules)
|
||||||
{
|
{
|
||||||
$sorter = [];
|
$key = $ver = [];
|
||||||
foreach($modules as $id => $module) {
|
foreach($modules as $i => $module) {
|
||||||
$sorter[$id] = $id;
|
$key[$i] = $module['id'] ?? $i;
|
||||||
|
$ver[$i] = $module['version'];
|
||||||
}
|
}
|
||||||
array_multisort($sorter, SORT_ASC, $modules);
|
array_multisort($key, SORT_ASC, $ver, SORT_ASC, $modules);
|
||||||
|
|
||||||
return $modules;
|
return $modules;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue