You are here

public static function MemcacheStorageAPI::flushClusters in Memcache Storage 7

Immediately invalidates all existing items in all memcached clusters.

File

./memcache_storage.api.inc, line 490
Provide class that processes memcached operations.

Class

MemcacheStorageAPI
Integrates with memcache API.

Code

public static function flushClusters() {
  $servers = variable_get('memcache_servers', array(
    '127.0.0.1:11211' => 'default',
  ));
  $clusters = array();
  foreach ($servers as $cluster_name) {
    if (!in_array($cluster_name, $clusters)) {
      $clusters[] = $cluster_name;
    }
  }
  foreach ($clusters as $cluster_name) {
    self::flushCluster($cluster_name);
  }
}