function drush_hacked_list_projects in Hacked! 5
Same name and namespace in other branches
- 8.2 hacked.drush.inc \drush_hacked_list_projects()
- 6.2 hacked.drush.inc \drush_hacked_list_projects()
- 6 hacked.drush.inc \drush_hacked_list_projects()
- 7.2 hacked.drush.inc \drush_hacked_list_projects()
Drush command callback that shows the listing of changed/unchanged projects.
File
- ./
hacked.drush.inc, line 64 - Hacked drush command.
Code
function drush_hacked_list_projects() {
// Go get the data:
if ($available = update_status_get_available(TRUE)) {
$data = update_status_calculate_project_data($available);
$data = hacked_calculate_project_data($data);
// Now print the data using drush:
$rows[] = array(
dt('Project'),
dt('Shortname'),
dt('Version'),
dt('Status'),
dt('Changed'),
dt('Deleted'),
);
foreach ($data as $project) {
$row = array(
empty($project['title']) ? $project['name'] : $project['title'],
$project['name'],
$project['existing_version'],
);
// Now add the status:
switch ($project['hacked_status']) {
case HACKED_STATUS_UNHACKED:
$row[] = dt('Unchanged');
break;
case HACKED_STATUS_HACKED:
$row[] = t('Changed');
break;
case HACKED_STATUS_UNCHECKED:
default:
$row[] = t('Unchecked');
break;
}
$row[] = $project['changed_count'];
$row[] = $project['deleted_count'];
$rows[] = $row;
}
drush_print_table($rows, TRUE);
}
}