UpdateFetcher::fetchProjectData

public UpdateFetcher::fetchProjectData(array $project, $site_key = '')

Retrieves the project information.

Parameters

array $project: The array of project information from \Drupal\Update\UpdateManager::getProjects().

string $site_key: (optional) The anonymous site key hash. Defaults to an empty string.

Return value

string The project information fetched as string. Empty string upon failure.

Overrides UpdateFetcherInterface::fetchProjectData

File

core/modules/update/src/UpdateFetcher.php, line 60

Class

UpdateFetcher
Fetches project information from remote locations.

Namespace

Drupal\update

Code

public function fetchProjectData(array $project, $site_key = '') {
  $url = $this->buildFetchUrl($project, $site_key);
  $data = '';
  try {
    $data = (string) $this->httpClient
      ->get($url, array('headers' => array('Accept' => 'text/xml')))
      ->getBody();
  }
  catch (RequestException $exception) {
    watchdog_exception('update', $exception);
  }
  return $data;
}
doc_Drupal
2016-10-29 09:50:41
Comments
Leave a Comment

Please login to continue.