3 namespace Drupal\update;
6 * Manages project update information.
8 interface UpdateManagerInterface {
11 * Project is missing security update(s).
16 * Current release has been unpublished and is no longer available.
21 * Current release is no longer supported by the project maintainer.
23 const NOT_SUPPORTED = 3;
26 * Project has a new release available, but it is not a security release.
28 const NOT_CURRENT = 4;
31 * Project is up to date.
36 * Fetches an array of installed and enabled projects.
38 * This is only responsible for generating an array of projects (taking into
39 * account projects that include more than one module or theme). Other
40 * information like the specific version and install type (official release,
41 * dev snapshot, etc) is handled later in update_process_project_info() since
42 * that logic is only required when preparing the status report, not for
43 * fetching the available release data.
45 * This array is fairly expensive to construct, since it involves a lot of
46 * disk I/O, so we store the results. However, since this is not the data
47 * about available updates fetched from the network, it is acceptable to
48 * invalidate it somewhat quickly. If we keep this data for very long, site
49 * administrators are more likely to see incorrect results if they upgrade to
50 * a newer version of a module or theme but do not visit certain pages that
51 * automatically clear this data.
54 * An associative array of currently enabled projects keyed by the
55 * machine-readable project short name. Each project contains:
56 * - name: The machine-readable project short name.
57 * - info: An array with values from the main .info.yml file for this
59 * - name: The human-readable name of the project.
60 * - package: The package that the project is grouped under.
61 * - version: The version of the project.
62 * - project: The Drupal.org project name.
63 * - datestamp: The date stamp of the project's main .info.yml file.
64 * - _info_file_ctime: The maximum file change time for all of the
66 * files included in this project.
67 * - datestamp: The date stamp when the project was released, if known.
68 * - includes: An associative array containing all projects included with
69 * this project, keyed by the machine-readable short name with the
70 * human-readable name as value.
71 * - project_type: The type of project. Allowed values are 'module' and
73 * - project_status: This indicates if the project is enabled and will
74 * always be TRUE, as the function only returns enabled projects.
76 * @see update_process_project_info()
77 * @see update_calculate_project_data()
78 * @see \Drupal\update\UpdateManager::projectStorage()
80 public function getProjects();
83 * Processes a step in batch for fetching available update data.
85 * @param array $context
86 * Reference to an array used for Batch API storage.
88 public function fetchDataBatch(&$context);
91 * Clears out all the available update data and initiates re-fetching.
93 public function refreshUpdateData();
96 * Retrieves update storage data or empties it.
98 * Two very expensive arrays computed by this module are the list of all
99 * installed modules and themes (and .info.yml data, project associations,
100 * etc), and the current status of the site relative to the currently
101 * available releases. These two arrays are stored and used whenever possible.
102 * The data is cleared whenever the administrator visits the status report,
103 * available updates report, or the module or theme administration pages,
104 * since we should always recompute the most current values on any of those
107 * Note: while both of these arrays are expensive to compute (in terms of disk
108 * I/O and some fairly heavy CPU processing), neither of these is the actual
109 * data about available updates that we have to fetch over the network from
110 * updates.drupal.org. That information is stored in the
111 * 'update_available_releases' collection -- it needs to persist longer than 1
112 * hour and never get invalidated just by visiting a page on the site.
115 * The key of data to return. Valid options are 'update_project_data' and
116 * 'update_project_projects'.
119 * The stored value of the $projects array generated by
120 * update_calculate_project_data() or
121 * \Drupal\Update\UpdateManager::getProjects(), or an empty array when the
122 * storage is cleared.
123 * array when the storage is cleared.
125 public function projectStorage($key);