Backup of db before drupal security update
[yaffs-website] / web / core / modules / update / src / UpdateFetcherInterface.php
1 <?php
2
3 namespace Drupal\update;
4
5 /**
6  * Fetches project information from remote locations.
7  */
8 interface UpdateFetcherInterface {
9
10   /**
11    * Project's status cannot be checked.
12    */
13   const NOT_CHECKED = -1;
14
15   /**
16    * No available update data was found for project.
17    */
18   const UNKNOWN = -2;
19
20   /**
21    * There was a failure fetching available update data for this project.
22    */
23   const NOT_FETCHED = -3;
24
25   /**
26    * We need to (re)fetch available update data for this project.
27    */
28   const FETCH_PENDING = -4;
29
30   /**
31    * Returns the base of the URL to fetch available update data for a project.
32    *
33    * @param array $project
34    *   The array of project information from
35    *   \Drupal\Update\UpdateManager::getProjects().
36    *
37    * @return string
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,
40    *   site_key, etc.
41    */
42   public function getFetchBaseUrl($project);
43
44   /**
45    * Retrieves the project information.
46    *
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.
52    *
53    * @return string
54    *   The project information fetched as string. Empty string upon failure.
55    */
56   public function fetchProjectData(array $project, $site_key = '');
57
58   /**
59    * Generates the URL to fetch information about project updates.
60    *
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.
64    *
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.
70    *
71    * @return string
72    *   The URL for fetching information about updates to the specified project.
73    *
74    * @see \Drupal\update\UpdateProcessor::fetchData()
75    * @see \Drupal\update\UpdateProcessor::processFetchTask()
76    * @see \Drupal\update\UpdateManager::getProjects()
77    */
78   public function buildFetchUrl(array $project, $site_key = '');
79
80 }