3 namespace Drupal\update;
6 * Fetches project information from remote locations.
8 interface UpdateFetcherInterface {
11 * Project's status cannot be checked.
13 const NOT_CHECKED = -1;
16 * No available update data was found for project.
21 * There was a failure fetching available update data for this project.
23 const NOT_FETCHED = -3;
26 * We need to (re)fetch available update data for this project.
28 const FETCH_PENDING = -4;
31 * Returns the base of the URL to fetch available update data for a project.
33 * @param array $project
34 * The array of project information from
35 * \Drupal\Update\UpdateManager::getProjects().
38 * The base of the URL used for fetching available update data. This does
39 * not include the path elements to specify a particular project, version,
42 public function getFetchBaseUrl($project);
45 * Retrieves the project information.
47 * @param array $project
48 * The array of project information from
49 * \Drupal\Update\UpdateManager::getProjects().
50 * @param string $site_key
51 * (optional) The anonymous site key hash. Defaults to an empty string.
54 * The project information fetched as string. Empty string upon failure.
56 public function fetchProjectData(array $project, $site_key = '');
59 * Generates the URL to fetch information about project updates.
61 * This figures out the right URL to use, based on the project's .info.yml
62 * file and the global defaults. Appends optional query arguments when the
63 * site is configured to report usage stats.
65 * @param array $project
66 * The array of project information from
67 * \Drupal\Update\UpdateManager::getProjects().
68 * @param string $site_key
69 * (optional) The anonymous site key hash. Defaults to an empty string.
72 * The URL for fetching information about updates to the specified project.
74 * @see \Drupal\update\UpdateProcessor::fetchData()
75 * @see \Drupal\update\UpdateProcessor::processFetchTask()
76 * @see \Drupal\update\UpdateManager::getProjects()
78 public function buildFetchUrl(array $project, $site_key = '');