sort modules by name and version
This commit is contained in:
parent
154506c0bf
commit
d55df97608
@ -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 New Issue
Block a user