function _update_cache_set

_update_cache_set($cid, $data, $expire)

Stores data in the private update status cache table.

Parameters

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

$data: The data to store.

$expire: One of the following values:

  • CACHE_PERMANENT: Indicates that the item should never be removed except by explicitly using _update_cache_clear().
  • A Unix timestamp: Indicates that the item should be kept at least until the given time, after which it will be invalidated.

See also

_update_cache_get()

Related topics

File

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

Code

function _update_cache_set($cid, $data, $expire) {
  $fields = array(
    'created' => REQUEST_TIME,
    'expire' => $expire,
  );
  if (!is_string($data)) {
    $fields['data'] = serialize($data);
    $fields['serialized'] = 1;
  }
  else {
    $fields['data'] = $data;
    $fields['serialized'] = 0;
  }
  db_merge('cache_update')
    ->key(array('cid' => $cid))
    ->fields($fields)
    ->execute();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!update!update.module/function/_update_cache_set/7.x