function api_tokens_cache_set in API Tokens 7
API Tokens cache_set wrapper connected to static storage.
1 call to api_tokens_cache_set()
- api_tokens_render in ./
api_tokens.module - Processes API tokens.
File
- ./
api_tokens.module, line 155 - The API Tokens module
Code
function api_tokens_cache_set($cid, $data, $token_info) {
$cache =& drupal_static('api_tokens_cache_get', FALSE);
// Storing to static.
$cache[$cid] = $data;
$expire = $token_info['cache_expire'];
// If cache isn't set to CACHE_PERMANENT (0) or CACHE_TEMPORARY (-1),
// adding request time to the expiration date in order to set correct
// expiration date.
if (0 < $expire) {
$expire += REQUEST_TIME;
}
cache_set($cid, $data, 'cache', $expire);
}