function _update_cache_set

7.x update.module _update_cache_set($cid, $data, $expire)
6.x update.module _update_cache_set($cid, $data, $expire)

Store data in the private update status cache table.

Note: this function completely ignores the {cache_update}.headers field since that is meaningless for the kinds of data we're caching.

Parameters

$cid: The cache ID to save the data with.

$data: The data to store.

$expire: One of the following values:

Related topics

3 calls to _update_cache_set()
update_calculate_project_data in drupal-6.x/modules/update/update.compare.inc
Given the installed projects and the available release data retrieved from remote servers, calculate the current status.
update_get_projects in drupal-6.x/modules/update/update.compare.inc
Fetch an array of installed and enabled projects.
_update_refresh in drupal-6.x/modules/update/update.fetch.inc
Fetch project info via XML from a central server.

File

drupal-6.x/modules/update/update.module, line 546
The "Update status" module checks for available updates of Drupal core and any installed contributed modules and themes. It warns site administrators if newer releases are available via the system status report (admin/reports/status), the…

Code

function _update_cache_set($cid, $data, $expire) {
  $serialized = 0;
  if (is_object($data) || is_array($data)) {
    $data = serialize($data);
    $serialized = 1;
  }
  $created = time();
  db_query("UPDATE {cache_update} SET data = %b, created = %d, expire = %d, serialized = %d WHERE cid = '%s'", $data, $created, $expire, $serialized, $cid);
  if (!db_affected_rows()) {
    @db_query("INSERT INTO {cache_update} (cid, data, created, expire, serialized) VALUES ('%s', %b, %d, %d, %d)", $cid, $data, $created, $expire, $serialized);
  }
}