Definition

cache_clear_all($cid = NULL, $wildcard = false)
drupal/includes/bootstrap.inc, line 244

Description

Expire data from the cache.

Parameters

$cid If set, the cache ID to delete. Otherwise, all cache entries that can expire are deleted.

$wildcard If set to true, the $cid is treated as a substring to match rather than a complete ID.

Code

function cache_clear_all($cid = NULL, $wildcard = false) {
  if (empty($cid)) {
    db_query("DELETE FROM {cache} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
  }
  else {
    if ($wildcard) {
      db_query("DELETE FROM {cache} WHERE cid LIKE '%%%s%%'", $cid);
    }
    else {
      db_query("DELETE FROM {cache} WHERE cid = '%s'", $cid);
    }
  }
}