function _drush_pm_sort_projects

3.x pm.drush.inc _drush_pm_sort_projects($a, $b)

Sort callback function for sorting projects First by type, second by package and third by name

Special handling for 'Package' on modules and themes.

1 string reference to '_drush_pm_sort_projects'
drush_pm_list in commands/pm/pm.drush.inc
Command callback. Show a list of modules and status.

File

commands/pm/pm.drush.inc, line 41
The drush Package Manager

Code

function _drush_pm_sort_projects($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;
}