You are here

interface UpdateFetcherInterface in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/update/src/UpdateFetcherInterface.php \Drupal\update\UpdateFetcherInterface
  2. 10 core/modules/update/src/UpdateFetcherInterface.php \Drupal\update\UpdateFetcherInterface

Fetches project information from remote locations.

Hierarchy

Expanded class hierarchy of UpdateFetcherInterface

All classes that implement UpdateFetcherInterface

7 files declare their use of UpdateFetcherInterface
update.api.php in core/modules/update/update.api.php
Hooks provided by the Update Manager module.
update.compare.inc in core/modules/update/update.compare.inc
Code required only when comparing available updates to existing data.
update.install in core/modules/update/update.install
Install, update, and uninstall functions for the Update Manager module.
update.module in core/modules/update/update.module
Handles updates of Drupal core and contributed projects.
update.report.inc in core/modules/update/update.report.inc
Code required only when rendering the available updates report.

... See full list

File

core/modules/update/src/UpdateFetcherInterface.php, line 8

Namespace

Drupal\update
View source
interface UpdateFetcherInterface {

  /**
   * Project's status cannot be checked.
   */
  const NOT_CHECKED = -1;

  /**
   * No available update data was found for project.
   */
  const UNKNOWN = -2;

  /**
   * There was a failure fetching available update data for this project.
   */
  const NOT_FETCHED = -3;

  /**
   * We need to (re)fetch available update data for this project.
   */
  const FETCH_PENDING = -4;

  /**
   * Returns the base of the URL to fetch available update data for a project.
   *
   * @param array $project
   *   The array of project information from
   *   \Drupal\update\UpdateManager::getProjects().
   *
   * @return 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.
   */
  public function getFetchBaseUrl($project);

  /**
   * Retrieves the project information.
   *
   * @param array $project
   *   The array of project information from
   *   \Drupal\update\UpdateManager::getProjects().
   * @param string $site_key
   *   (optional) The anonymous site key hash. Defaults to an empty string.
   *
   * @return string
   *   The project information fetched as string. Empty string upon failure.
   */
  public function fetchProjectData(array $project, $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.
   *
   * @param array $project
   *   The array of project information from
   *   \Drupal\update\UpdateManager::getProjects().
   * @param string $site_key
   *   (optional) The anonymous site key hash. Defaults to an empty string.
   *
   * @return string
   *   The URL for fetching information about updates to the specified project.
   *
   * @see \Drupal\update\UpdateProcessor::fetchData()
   * @see \Drupal\update\UpdateProcessor::processFetchTask()
   * @see \Drupal\update\UpdateManager::getProjects()
   */
  public function buildFetchUrl(array $project, $site_key = '');

}

Members

Namesort descending Modifiers Type Description Overrides
UpdateFetcherInterface::buildFetchUrl public function Generates the URL to fetch information about project updates. 1
UpdateFetcherInterface::fetchProjectData public function Retrieves the project information. 1
UpdateFetcherInterface::FETCH_PENDING constant We need to (re)fetch available update data for this project.
UpdateFetcherInterface::getFetchBaseUrl public function Returns the base of the URL to fetch available update data for a project. 1
UpdateFetcherInterface::NOT_CHECKED constant Project's status cannot be checked.
UpdateFetcherInterface::NOT_FETCHED constant There was a failure fetching available update data for this project.
UpdateFetcherInterface::UNKNOWN constant No available update data was found for project.