You are here

function dmemcache_close in Memcache API and Integration 6

Same name and namespace in other branches
  1. 7 dmemcache.inc \dmemcache_close()

Close the connection to the memcache instance.

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

File

./dmemcache.inc, line 652

Code

function dmemcache_close($memcache) {
  $extension = dmemcache_extension();
  if ($extension == 'Memcache' && $memcache instanceof Memcache) {
    $rc = @$memcache->close;
  }
  elseif ($extension == 'Memcached' && $memcache instanceof Memcached) {
    $rc = @$memcache->quit;
  }
  else {
    $rc = FALSE;
  }
  return $rc;
}