_update_cache_set

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 _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.

Übergabeparameter

$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.

Verwandte Themen

▾ 3 functions call _update_cache_set()

update_calculate_project_data in 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 modules/update/update.compare.inc
Fetch an array of installed and enabled projects.
_update_refresh in modules/update/update.fetch.inc
Fetch project info via XML from a central server.

Code

modules/update/update.module, line 545

<?php
function _update_cache_set($cid, $data, $expire) {
  $fields = array(
    'created' => REQUEST_TIME,
    'expire' => $expire,
    'headers' => NULL,
  );
  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();
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen