You are here

public function DriverBase::flush in Memcache API and Integration 8.2

Immediately invalidates all existing items.

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

Return value

bool TRUE on success or FALSE on failure.

Overrides DrupalMemcacheInterface::flush

File

src/Driver/DriverBase.php, line 135

Class

DriverBase
Class DriverBase.

Namespace

Drupal\memcache\Driver

Code

public function flush() {
  $collect_stats = $this
    ->statsInit();
  $result = $this->memcache
    ->flush();
  if ($collect_stats) {
    $this
      ->statsWrite('flush', 'cache', [
      '' => $result,
    ]);
  }
}