You are here

function _memcached_ascii_auth_version_valid in Memcache API and Integration 7

If ASCII protocol authentication is enabled, validate whether the current memcached version meets the minimum and/or recommended requirements.

2 calls to _memcached_ascii_auth_version_valid()
memcache_enable in ./memcache.install
Implements hook_enable().
memcache_requirements in ./memcache.install
Implements hook_requirements().

File

./memcache.install, line 288
Install, update and uninstall functions for the memcache module.

Code

function _memcached_ascii_auth_version_valid($version) {
  if (_dmemcache_use_ascii_auth()) {
    $stats = dmemcache_stats();
    foreach ($stats as $bin => $servers) {
      if (!empty($servers)) {
        foreach ($servers as $server => $value) {
          $installed_version = $value['version'];
          if (version_compare($installed_version, $version, '<')) {

            // Return detected invalid version of memcached.
            return $installed_version;
          }
        }
      }
      else {
        return FALSE;
      }
    }
  }

  // Fall through if no unsupported version of memcached was detected, or ascii auth is
  // not enabled.
  return TRUE;
}