function rules_set_cache

Sets a rules cache item.

In addition to calling cache_set(), this function makes sure the cache item is immediately available via rules_get_cache() by keeping all cache items in memory. That way we can guarantee rules_get_cache() is able to retrieve any cache item, even if all cache gets fail.

See also

rules_get_cache()

3 calls to rules_set_cache()
RulesEventSet::rebuildEventCache in includes/rules.plugins.inc
Rebuilds the event cache.
rules_update_7214 in ./rules.install
Switch out the rules_event_whitelist variable for a cache equivalent.
_rules_rebuild_component_cache in ./rules.module
Cache components to allow efficient usage via rules_invoke_component().

File

./rules.module, line 515

Code

function rules_set_cache($cid, $data) {
    $cache =& drupal_static('rules_get_cache', array());
    $cache[$cid] = $data;
    cache_set($cid, $data, 'cache_rules');
}