You are here

function cache_clear_all in Memcache API and Integration 5.2

Same name in this branch
  1. 5.2 memcache.db.inc \cache_clear_all()
  2. 5.2 memcache.inc \cache_clear_all()
Same name and namespace in other branches
  1. 5 memcache.db.inc \cache_clear_all()
  2. 5 memcache.inc \cache_clear_all()
  3. 6 memcache.db.inc \cache_clear_all()
  4. 6 memcache.inc \cache_clear_all()

Expire data from the cache. If called without arguments, expirable entries will be cleared from the cache_page table.

Parameters

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

$table: If set, the table $table to delete from. Mandatory argument if $cid is set.

$wildcard: If set to TRUE, the $cid is treated as a substring to match rather than a complete ID. The match is a right hand match. If '*' is given as $cid, the table $table will be emptied.

File

./memcache.inc, line 82

Code

function cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE) {

  // Memcache logic is simpler because memcache doesn't have a minimum cache
  // lifetime consideration (it handles it internally), and doesn't support
  // wildcards.
  $bin = empty($table) ? 'cache' : $table;
  if (empty($cid) || $cid == '*') {
    dmemcache_flush($table);
  }
  else {
    dmemcache_delete($cid, $table);
  }
}