You are here

function variable_cache_clear in Variable 6

Same name and namespace in other branches
  1. 7.2 variable.module \variable_cache_clear()
  2. 7 variable.module \variable_cache_clear()

Clear cache

1 call to variable_cache_clear()
variable_admin_reset_form_submit in variable_admin/variable_admin.pages.inc

File

./variable.module, line 233
Variable API module

Code

function variable_cache_clear($name = NULL, $langcode = NULL) {
  if ($name || $langcode) {
    $cids = array(
      $name ? $name : '%',
      $langcode ? $langcode : '%',
    );
    db_query("DELETE FROM {variable_cache} WHERE cid LIKE '%s'", implode(':', $cids));
  }
  else {
    db_query("TRUNCATE TABLE {variable_cache}");
  }
}