You are here

public function UpdateFetcher::getFetchBaseUrl in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/update/src/UpdateFetcher.php \Drupal\update\UpdateFetcher::getFetchBaseUrl()

Returns the base of the URL to fetch available update data for a project.

Parameters

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

Return value

string The base of the URL used for fetching available update data. This does not include the path elements to specify a particular project, version, site_key, etc.

Overrides UpdateFetcherInterface::getFetchBaseUrl

1 call to UpdateFetcher::getFetchBaseUrl()
UpdateFetcher::buildFetchUrl in core/modules/update/src/UpdateFetcher.php
Generates the URL to fetch information about project updates.

File

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

Class

UpdateFetcher
Fetches project information from remote locations.

Namespace

Drupal\update

Code

public function getFetchBaseUrl($project) {
  if (isset($project['info']['project status url'])) {
    $url = $project['info']['project status url'];
  }
  else {
    $url = $this->fetchUrl;
    if (empty($url)) {
      $url = static::UPDATE_DEFAULT_URL;
    }
  }
  return $url;
}