You are here

function _dmemcache_reset_ascii_auth in Memcache API and Integration 7

If using ascii authentication, re-authenticates all servers.

Parameters

string $mc: The mc object to re-authenticate all servers on.

Return value

bool TRUE on success, FALSE on failure.

3 calls to _dmemcache_reset_ascii_auth()
dmemcache_flush in ./dmemcache.inc
Flush all stored items.
dmemcache_stats in ./dmemcache.inc
Retrieves statistics recorded during memcache operations.
memcache-lock.inc in ./memcache-lock.inc

File

./dmemcache.inc, line 1509
A memcache API for Drupal.

Code

function _dmemcache_reset_ascii_auth($mc) {
  static $memcache_ascii_auth = NULL;
  if (!isset($memcache_ascii_auth)) {
    $memcache_ascii_auth = _dmemcache_use_ascii_auth();
  }
  if (!$memcache_ascii_auth) {
    return FALSE;
  }

  // Need to check all servers for authentication.
  $servers = $mc
    ->getServerList();
  foreach ($servers as $s) {
    $rc = _dmemcache_ascii_authenticate_server($s['host'], $s['port'], $mc);
    if (!$rc) {
      return FALSE;
    }
  }
  return TRUE;
}