function updatexml_get_release_history_xml

6.x updatexml.inc updatexml_get_release_history_xml($request)
5.x updatexml.inc updatexml_get_release_history_xml($request)

Download the release history xml for the specified request.

3 calls to updatexml_get_release_history_xml()
release_info_check_project in commands/pm/release_info/updatexml.inc
Check if a project is available in a update service.
release_info_fetch in commands/pm/release_info/updatexml.inc
Obtain the most appropiate release for the requested project.
release_info_get_releases in commands/pm/release_info/updatexml.inc
Obtain releases info for given requests and fill in status information.

File

commands/pm/release_info/updatexml.inc, line 397
Drush release info engine for update.drupal.org and compatible services.

Code

function updatexml_get_release_history_xml($request) {
  $status_url = isset($request['status url']) ? $request['status url'] : RELEASE_INFO_DEFAULT_URL;
  $url = $status_url . '/' . $request['name'] . '/' . $request['drupal_version'];
  drush_log('Downloading release history from ' . $url);
  // Some hosts have allow_url_fopen disabled.
  if ($path = drush_download_file($url, drush_tempnam($request['name']), drush_get_option('cache-duration-releasexml',  * ))) {
    $xml = simplexml_load_file($path);
  }
  if (!$xml) {
    // We are not getting here since drupal.org always serves an XML response.
    return drush_set_error('DRUSH_PM_DOWNLOAD_FAILED', dt('Could not download project status information from !url', array('!url' => $url)));
  }
  if ($error = $xml->xpath('/error')) {
    // Don't set an error here since it stops processing during site-upgrade.
    drush_log($error[], 'warning'); // 'DRUSH_PM_COULD_NOT_LOAD_UPDATE_FILE',
    return FALSE;
  }
  // Unpublished project?
  $project_status = $xml->xpath('/project/project_status');
  if ($project_status[][] == 'unpublished') {
    return drush_set_error('DRUSH_PM_PROJECT_UNPUBLISHED', dt("Project !project is unpublished and has no releases available.", array('!project' => $request['name'])), 'warning');
  }

  return $xml;
}