You are here

function _drush_l10n_update_get_updates in Localization update 7

Same name and namespace in other branches
  1. 6 l10n_update.drush.inc \_drush_l10n_update_get_updates()
  2. 7.2 l10n_update.drush.inc \_drush_l10n_update_get_updates()

Helper function to obtain $updates.

Return value

$updates array or NULL.

2 calls to _drush_l10n_update_get_updates()
drush_l10n_update in ./l10n_update.drush.inc
Callback for command l10n-update.
drush_l10n_update_status in ./l10n_update.drush.inc
Callback for command l10n-update-status.

File

./l10n_update.drush.inc, line 194
Drush interface to l10n-update functionalities.

Code

function _drush_l10n_update_get_updates() {
  $projects = l10n_update_get_projects();
  if ($projects) {
    $history = l10n_update_get_history();
    drush_log(dt('Fetching update information for all projects / all languages.'), 'status');
    module_load_include('check.inc', 'l10n_update');
    $available = l10n_update_available_releases();
    $updates = l10n_update_build_updates($history, $available);
    return $updates;
  }
  else {
    drush_log(dt('No projects or languages to update.'), 'ok');
  }
}