UpdateManagerInterface
interface UpdateManagerInterface (View source)
Manages project update information.
Constants
| NOT_SECURE |
Project is missing security update(s). |
| REVOKED |
Current release has been unpublished and is no longer available. |
| NOT_SUPPORTED |
Current release is no longer supported by the project maintainer. |
| NOT_CURRENT |
Project has a new release available, but it is not a security release. |
| CURRENT |
Project is up to date. |
Methods
Fetches an array of installed and enabled projects.
Processes a step in batch for fetching available update data.
Clears out all the available update data and initiates re-fetching.
Retrieves update storage data or empties it.
Details
array
getProjects()
Fetches an array of installed and enabled projects.
This is only responsible for generating an array of projects (taking into account projects that include more than one module or theme). Other information like the specific version and install type (official release, dev snapshot, etc) is handled later in update_process_project_info() since that logic is only required when preparing the status report, not for fetching the available release data.
This array is fairly expensive to construct, since it involves a lot of disk I/O, so we store the results. However, since this is not the data about available updates fetched from the network, it is acceptable to invalidate it somewhat quickly. If we keep this data for very long, site administrators are more likely to see incorrect results if they upgrade to a newer version of a module or theme but do not visit certain pages that automatically clear this data.
fetchDataBatch(array $context)
Processes a step in batch for fetching available update data.
Before calling this method, call UpdateManagerInterface::refreshUpdateData() to clear existing update data and initiate re-fetching.
refreshUpdateData()
Clears out all the available update data and initiates re-fetching.
array
projectStorage(string $key)
Retrieves update storage data or empties it.
Two very expensive arrays computed by this module are the list of all installed modules and themes (and .info.yml data, project associations, etc), and the current status of the site relative to the currently available releases. These two arrays are stored and used whenever possible. The data is cleared whenever the administrator visits the status report, available updates report, or the module or theme administration pages, since we should always recompute the most current values on any of those pages.
Note: while both of these arrays are expensive to compute (in terms of disk I/O and some fairly heavy CPU processing), neither of these is the actual data about available updates that we have to fetch over the network from updates.drupal.org. That information is stored in the 'update_available_releases' collection -- it needs to persist longer than 1 hour and never get invalidated just by visiting a page on the site.