| 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.
$cid The cache ID to save the data with.
$data The data to store.
$expire One of the following values:
modules/
<?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