Issue #2448069 by a_thakur, JeroenT, Mile23: Remove usage and function update_project_storage() from update.compare.inc
parent
a9b27b5174
commit
40c8a0353b
|
@ -129,11 +129,11 @@ function update_process_project_info(&$projects) {
|
|||
* @see update_get_available()
|
||||
* @see update_get_projects()
|
||||
* @see update_process_project_info()
|
||||
* @see update_project_storage()
|
||||
* @see \Drupal\update\UpdateManagerInterface::projectStorage()
|
||||
*/
|
||||
function update_calculate_project_data($available) {
|
||||
// Retrieve the projects from storage, if present.
|
||||
$projects = update_project_storage('update_project_data');
|
||||
$projects = \Drupal::service('update.manager')->projectStorage('update_project_data');
|
||||
// If $projects is empty, then the data must be rebuilt.
|
||||
// Otherwise, return the data and skip the rest of the function.
|
||||
if (!empty($projects)) {
|
||||
|
@ -541,39 +541,3 @@ function update_calculate_project_update_status(&$project_data, $available) {
|
|||
$project_data['reason'] = t('Invalid info');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param $key
|
||||
* The key of data to return. Valid options are 'update_project_data' and
|
||||
* 'update_project_projects'.
|
||||
*
|
||||
* @return
|
||||
* The stored value of the $projects array generated by
|
||||
* update_calculate_project_data() or update_get_projects(), or an empty array
|
||||
* when the storage is cleared.
|
||||
*
|
||||
* @see \Drupal\update\UpdateManager::projectStorage()
|
||||
*
|
||||
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
|
||||
* Use \Drupal::service('update.manager')->projectStorage().
|
||||
*/
|
||||
function update_project_storage($key) {
|
||||
return \Drupal::service('update.manager')->projectStorage($key);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue