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)
|
||||
{
|
||||
$sorter = [];
|
||||
foreach($modules as $id => $module) {
|
||||
$sorter[$id] = $id;
|
||||
$key = $ver = [];
|
||||
foreach($modules as $i => $module) {
|
||||
$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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue