interface UpdateFetcherInterface (View source)

Fetches project information from remote locations.

Constants

NOT_CHECKED

Project's status cannot be checked.

UNKNOWN

No available update data was found for project.

NOT_FETCHED

There was a failure fetching available update data for this project.

FETCH_PENDING

We need to (re)fetch available update data for this project.

Methods

string
getFetchBaseUrl(array $project)

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

string
fetchProjectData(array $project, string $site_key = '')

Retrieves the project information.

string
buildFetchUrl(array $project, string $site_key = '')

Generates the URL to fetch information about project updates.

Details

string getFetchBaseUrl(array $project)

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.

string fetchProjectData(array $project, string $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.

string buildFetchUrl(array $project, string $site_key = '')

Generates the URL to fetch information about project updates.

This figures out the right URL to use, based on the project's .info.yml file and the global defaults. Appends optional query arguments when the site is configured to report usage stats.

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 URL for fetching information about updates to the specified project.

See also

UpdateProcessor::fetchData
UpdateProcessor::processFetchTask
UpdateManager::getProjects