annotate core/modules/update/src/UpdateFetcherInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\update;
Chris@0 4
Chris@0 5 /**
Chris@0 6 * Fetches project information from remote locations.
Chris@0 7 */
Chris@0 8 interface UpdateFetcherInterface {
Chris@0 9
Chris@0 10 /**
Chris@0 11 * Project's status cannot be checked.
Chris@0 12 */
Chris@0 13 const NOT_CHECKED = -1;
Chris@0 14
Chris@0 15 /**
Chris@0 16 * No available update data was found for project.
Chris@0 17 */
Chris@0 18 const UNKNOWN = -2;
Chris@0 19
Chris@0 20 /**
Chris@0 21 * There was a failure fetching available update data for this project.
Chris@0 22 */
Chris@0 23 const NOT_FETCHED = -3;
Chris@0 24
Chris@0 25 /**
Chris@0 26 * We need to (re)fetch available update data for this project.
Chris@0 27 */
Chris@0 28 const FETCH_PENDING = -4;
Chris@0 29
Chris@0 30 /**
Chris@0 31 * Returns the base of the URL to fetch available update data for a project.
Chris@0 32 *
Chris@0 33 * @param array $project
Chris@0 34 * The array of project information from
Chris@0 35 * \Drupal\Update\UpdateManager::getProjects().
Chris@0 36 *
Chris@0 37 * @return string
Chris@0 38 * The base of the URL used for fetching available update data. This does
Chris@0 39 * not include the path elements to specify a particular project, version,
Chris@0 40 * site_key, etc.
Chris@0 41 */
Chris@0 42 public function getFetchBaseUrl($project);
Chris@0 43
Chris@0 44 /**
Chris@0 45 * Retrieves the project information.
Chris@0 46 *
Chris@0 47 * @param array $project
Chris@0 48 * The array of project information from
Chris@0 49 * \Drupal\Update\UpdateManager::getProjects().
Chris@0 50 * @param string $site_key
Chris@0 51 * (optional) The anonymous site key hash. Defaults to an empty string.
Chris@0 52 *
Chris@0 53 * @return string
Chris@0 54 * The project information fetched as string. Empty string upon failure.
Chris@0 55 */
Chris@0 56 public function fetchProjectData(array $project, $site_key = '');
Chris@0 57
Chris@0 58 /**
Chris@0 59 * Generates the URL to fetch information about project updates.
Chris@0 60 *
Chris@0 61 * This figures out the right URL to use, based on the project's .info.yml
Chris@0 62 * file and the global defaults. Appends optional query arguments when the
Chris@0 63 * site is configured to report usage stats.
Chris@0 64 *
Chris@0 65 * @param array $project
Chris@0 66 * The array of project information from
Chris@0 67 * \Drupal\Update\UpdateManager::getProjects().
Chris@0 68 * @param string $site_key
Chris@0 69 * (optional) The anonymous site key hash. Defaults to an empty string.
Chris@0 70 *
Chris@0 71 * @return string
Chris@0 72 * The URL for fetching information about updates to the specified project.
Chris@0 73 *
Chris@0 74 * @see \Drupal\update\UpdateProcessor::fetchData()
Chris@0 75 * @see \Drupal\update\UpdateProcessor::processFetchTask()
Chris@0 76 * @see \Drupal\update\UpdateManager::getProjects()
Chris@0 77 */
Chris@0 78 public function buildFetchUrl(array $project, $site_key = '');
Chris@0 79
Chris@0 80 }