You are here

function dmemcache_flush in Memcache API and Integration 6

Same name and namespace in other branches
  1. 5.2 dmemcache.inc \dmemcache_flush()
  2. 5 dmemcache.inc \dmemcache_flush()
  3. 7 dmemcache.inc \dmemcache_flush()

Immediately invalidates all existing items. dmemcache_flush doesn't actually free any resources, it only marks all the items as expired, so occupied memory will be overwritten by new items.

Parameters

$bin The bin to flush. Note that this will flush all bins mapped to the same server: as $bin. There is no way at this time to empty just one bin.

Return value

Returns TRUE on success or FALSE on failure.

1 call to dmemcache_flush()
cache_clear_all in ./memcache.db.inc
Expire data from the cache. If called without arguments, expirable entries will be cleared from the cache_page table.

File

./dmemcache.inc, line 486

Code

function dmemcache_flush($bin = 'cache') {
  $collect_stats = dmemcache_stats_init();
  $rc = FALSE;
  if ($mc = dmemcache_object($bin)) {
    $rc = $mc
      ->flush();
  }
  if ($collect_stats) {
    dmemcache_stats_write('flush', $bin, array(
      '' => $rc,
    ));
  }
  return $rc;
}