function _drush_pm_sort_extensions
| 6.x pm.drush.inc | _drush_pm_sort_extensions($a, $b) |
| 5.x pm.drush.inc | _drush_pm_sort_extensions($a, $b) |
| 4.x pm.drush.inc | _drush_pm_sort_extensions($a, $b) |
Sort callback function for sorting extensions.
It will sort first by type, second by package and third by name.
Related topics
1 string reference to '_drush_pm_sort_extensions'
- drush_pm_list in commands/
pm/ pm.drush.inc - Command callback. Show a list of extensions with type and status.
File
- commands/
pm/ pm.drush.inc, line 267 - The drush Project Manager
Code
function _drush_pm_sort_extensions($a, $b) {
if ($a->type == 'module' && $b->type == 'theme') {
return -1;
}
if ($a->type == 'theme' && $b->type == 'module') {
return 1;
}
$cmp = strcasecmp($a->info['package'], $b->info['package']);
if ($cmp == 0) {
$cmp = strcasecmp($a->info['name'], $b->info['name']);
}
return $cmp;
}