You are here

function drush_memcache_flush in Memcache API and Integration 7

Invalidate all items in specified bin.

Parameters

string $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

bool Returns TRUE on success or FALSE on failure.

File

./memcache.drush.inc, line 91
Provides a drush interface to Memcached.

Code

function drush_memcache_flush($bin = 'cache') {
  if (_memcache_is_available()) {
    $flushed = dmemcache_flush($bin);
    if ($flushed === TRUE) {
      drush_log(dt('Successfully cleared !bin bin.', array(
        '!bin' => $bin,
      )), 'ok');
    }
    else {
      drush_log(dt('Failed to clear !bin bin.', array(
        '!bin' => $bin,
      )), 'error');
    }
  }
}