You are here

function upgrade_status_project_cache in Upgrade Status 5

Retrieve data from {cache} or empty the cache when necessary.

Two very expensive arrays computed by this module are the list of all installed modules (and .info data, project associations, etc), and the current status of the site relative to the currently available releases. These two arrays are cached in the {cache} table and used whenever possible. The cache is cleared whenever the administrator visits the status report, available updates report, or the module administration pages, since we should always recompute the most current values on any of those pages.

Parameters

$cid: The cache id of data to return from the cache. Valid options are 'upgrade_status_data' and 'update_status_projects'.

Return value

The cached value of the $projects array generated by upgrade_status_calculate_project_data() or update_status_get_projects(), or an empty array when the cache is cleared.

1 call to upgrade_status_project_cache()
upgrade_status_calculate_project_data in ./upgrade_status.admin.inc
Given the installed projects and the available release data retrieved from remote servers, calculate the current status.

File

./upgrade_status.admin.inc, line 684
Checks to see if your installed modules are available for the next major release of Drupal.

Code

function upgrade_status_project_cache($cid) {
  $projects = array();
  if ($cache = cache_get($cid, 'cache')) {
    if (!empty($cache->data) && $cache->expire > time()) {
      $projects = unserialize($cache->data);
    }
  }
  return $projects;
}