private function StatusInfoDrush::calculateProjectStatus

8.0.x StatusInfoDrush.php private StatusInfoDrush::calculateProjectStatus($project_release_info)
7.x StatusInfoDrush.php private StatusInfoDrush::calculateProjectStatus($project_release_info)
master StatusInfoDrush.php private StatusInfoDrush::calculateProjectStatus($project_release_info)

Obtain the project status in the update service.

This is not the update status of the installed version but the project 'global' status (unpublished, revoked, etc).

See also

update_calculate_project_status().

1 call to StatusInfoDrush::calculateProjectStatus()
StatusInfoDrush::calculateUpdateStatus in lib/Drush/UpdateService/StatusInfoDrush.php
Calculates update status for given projects.

File

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

Namespace

Drush\UpdateService

Class

StatusInfoDrush

Code

private function calculateProjectStatus($project_release_info) {
  $project_status = NULL;

  // If connection to the update service went wrong, or the received xml
  // is malformed, we don't have a UpdateService::Project object.
  if (!$project_release_info) {
    $project_status = DRUSH_UPDATESTATUS_NOT_FETCHED;
  }
  else {
    switch ($project_release_info->getStatus()) {
      case 'insecure':
        $project_status = DRUSH_UPDATESTATUS_NOT_SECURE;
        break;
      case 'unpublished':
      case 'revoked':
        $project_status = DRUSH_UPDATESTATUS_REVOKED;
        break;
      case 'unsupported':
        $project_status = DRUSH_UPDATESTATUS_NOT_SUPPORTED;
        break;
      case 'unknown':
        $project_status = DRUSH_UPDATESTATUS_UNKNOWN;
        break;
    }
  }
  return $project_status;
}