You are here

function _update_get_cached_available_releases in Drupal 7

Returns all currently cached data about available releases for all projects.

Return value

Array of data about available releases, keyed by project shortname.

1 call to _update_get_cached_available_releases()
update_get_available in modules/update/update.module
Tries to get update information from cache and refreshes it when necessary.

File

modules/update/update.module, line 488
Handles updates of Drupal core and contributed projects.

Code

function _update_get_cached_available_releases() {
  $data = array();
  $cache_items = _update_get_cache_multiple('available_releases');
  foreach ($cache_items as $cid => $cache) {
    $cache->data['last_fetch'] = $cache->created;
    if ($cache->expire < REQUEST_TIME) {
      $cache->data['fetch_status'] = UPDATE_FETCH_PENDING;
    }

    // The project shortname is embedded in the cache ID, even if there's no
    // data for this project in the DB at all, so use that for the indexes in
    // the array.
    $parts = explode('::', $cid, 2);
    $data[$parts[1]] = $cache->data;
  }
  return $data;
}