function update_calculate_project_data
Same name and namespace in other branches
- 11.x core/modules/update/update.compare.inc \update_calculate_project_data()
- 10 core/modules/update/update.compare.inc \update_calculate_project_data()
- 9 core/modules/update/update.compare.inc \update_calculate_project_data()
- 8.9.x core/modules/update/update.compare.inc \update_calculate_project_data()
- 7.x modules/update/update.compare.inc \update_calculate_project_data()
Calculates the current update status of all projects on the site.
The results of this function are expensive to compute, especially on sites with lots of modules or themes, since it involves a lot of comparisons and other operations. Therefore, we store the results. However, since this is not the data about available updates fetched from the network, it is ok 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.
Parameters
array $available: Data about available project releases.
Return value
array An array of installed projects with current update status information.
Deprecated
in drupal:11.5.0 and is removed from drupal:13.0.0. Use \Drupal::service(UpdateManagerInterface::class) ->calculateProjectData($available) instead.
See also
\Drupal\update\UpdateManagerInterface::getAvailable()
\Drupal\update\UpdateManagerInterface::getProjects()
\Drupal\update\UpdateCalculator::processProjectInfo()
\Drupal\update\UpdateManagerInterface::projectStorage()
\Drupal\update\ProjectCoreCompatibility::setReleaseMessage()
https://www.drupal.org/node/3587768
File
-
core/
modules/ update/ update.compare.inc, line 63
Code
function update_calculate_project_data($available) {
@trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.5.0 and is removed from drupal:13.0.0. Use \\Drupal::service(UpdateManagerInterface::class)->calculateProjectData($available) instead. See https://www.drupal.org/node/3587768', E_USER_DEPRECATED);
return \Drupal::service(UpdateManagerInterface::class)->calculateProjectData($available);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.