You are here

function cache_actions_action_clear_cache in Cache Actions 6.2

Same name and namespace in other branches
  1. 6 cache_actions.rules.inc \cache_actions_action_clear_cache()
  2. 7.2 cache_actions.rules.inc \cache_actions_action_clear_cache()
  3. 7 cache_actions.rules.inc \cache_actions_action_clear_cache()

This action that clears all cache tables specified.

Parameters

$tables the tables to be cleared:

1 string reference to 'cache_actions_action_clear_cache'
cache_actions_test_rules_defaults in cache_actions_test/cache_actions_test.rules_defaults.inc
Implementation of hook_rules_defaults(). Below are the rules needed for the testing.

File

./cache_actions.rules.inc, line 798
This file provides the rules integration for this module.

Code

function cache_actions_action_clear_cache($tables) {
  $cache_tables = _cache_actions_get_cache_bins();

  // Support rules from 1.x.
  if (is_string($tables)) {
    $tables = explode(',', $tables);
  }
  foreach ($tables as $table) {
    if (in_array($table, $cache_tables)) {
      cache_clear_all('*', $table, TRUE);
    }
  }
}