private function StatusInfoDrush::calculateUpdateStatus

8.0.x StatusInfoDrush.php private StatusInfoDrush::calculateUpdateStatus($available, $projects)
7.x StatusInfoDrush.php private StatusInfoDrush::calculateUpdateStatus($available, $projects)
master StatusInfoDrush.php private StatusInfoDrush::calculateUpdateStatus($available, $projects)

Calculates update status for given projects.

1 call to StatusInfoDrush::calculateUpdateStatus()
StatusInfoDrush::getStatus in lib/Drush/UpdateService/StatusInfoDrush.php
Get update information for all installed projects.


lib/Drush/UpdateService/StatusInfoDrush.php, line 109
Implementation of 'drush' update_status engine for any Drupal version.






private function calculateUpdateStatus($available, $projects) {
  $update_info = array();
  foreach ($available as $project_name => $project_release_info) {
    // Obtain project 'global' status. NULL status is ok (project published),
    // otherwise it signals something is bad with the project (revoked, etc).
    $project_status = $this->calculateProjectStatus($project_release_info);
    // Discard custom projects.
    if ($project_status == DRUSH_UPDATESTATUS_UNKNOWN) {

    // Prepare update info.
    $project = $projects[$project_name];
    $is_core = ($project['type'] == 'core');
    $version = pm_parse_version($project['version'], $is_core);
    // If project version ends with 'dev', this is a dev snapshot.
    $install_type = (substr($project['version'], -3, 3) == 'dev') ? 'dev' : 'official';
    $project_update_info = array(
      'name' => $project_name,
      'label' => $project['label'],
      'path' => isset($project['path']) ? $project['path'] : '',
      'install_type' => $install_type,
      'existing_version' => $project['version'],
      'existing_major' => $version['version_major'],
      'status' => $project_status,
      'datestamp' => empty($project['datestamp']) ? NULL : $project['datestamp'],

    // If we don't have a project status yet, it means this is
    // a published project and we need to obtain its update status
    // and recommended release.
    if (is_null($project_status)) {
      $this->calculateProjectUpdateStatus($project_release_info, $project_update_info);

    // We want to ship all release info data including all releases,
    // not just the ones selected by calculateProjectUpdateStatus().
    // We use it to allow the user to update to a specific version.
    $update_info[$project_name] = $project_update_info + $project_release_info->getInfo();

  return $update_info;