You are here

function _rules_rebuild_cache in Rules 7.2

Rebuilds the rules cache.

This rebuilds the rules 'data' cache and invokes rebuildCache() methods on all plugin classes, which allows plugins to add their own data to the cache. The cache is rebuilt in the order the plugins are defined.

Note that building the action/condition info cache triggers loading of all components, thus depends on entity-loading and so syncing entities in code to the database.

See also

rules_rules_plugin_info()

entity_defaults_rebuild()

1 call to _rules_rebuild_cache()
rules_get_cache in ./rules.module
Gets a rules cache entry.

File

./rules.module, line 439
Rules engine module.

Code

function _rules_rebuild_cache(&$cache) {
  foreach (array(
    'data_info',
    'plugin_info',
  ) as $hook) {
    $cache[$hook] = rules_fetch_data($hook);
  }
  foreach ($cache['plugin_info'] as $name => &$info) {

    // Let the items add something to the cache.
    $item = new $info['class']();
    $item
      ->rebuildCache($info, $cache);
  }
  $cid_suffix = ':' . $GLOBALS['language']->language;
  cache_set('data' . $cid_suffix, $cache, 'cache_rules');
}