function UpdateFetcher::fetchProjectData

Same name in other branches
  1. 9 core/modules/update/src/UpdateFetcher.php \Drupal\update\UpdateFetcher::fetchProjectData()
  2. 10 core/modules/update/src/UpdateFetcher.php \Drupal\update\UpdateFetcher::fetchProjectData()
  3. 11.x core/modules/update/src/UpdateFetcher.php \Drupal\update\UpdateFetcher::fetchProjectData()

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, [
            'headers' => [
                'Accept' => 'text/xml',
            ],
        ])
            ->getBody();
    } catch (RequestException $exception) {
        watchdog_exception('update', $exception);
    }
    return $data;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.