You are here

protected function MemcacheStorage::getBinIndex in Memcache Storage 7

Load cache bin index. This index is part of memcache key and changes if cache bin should be cleared.

2 calls to MemcacheStorage::getBinIndex()
MemcacheStorage::cacheBinName in ./memcache_storage.inc
Returns a cache bin name with namespace prefix.
MemcacheStorage::increaseBinIndex in ./memcache_storage.inc
Increase cache bin index. This operation changes all memcache keys in selected cache bin so we simulate cache flush for it.

File

./memcache_storage.inc, line 312
Provides class for memcached data handling.

Class

MemcacheStorage
Class handles memcached cache objects.

Code

protected function getBinIndex() {
  $indexes =& drupal_static('memcache_storage_bin_indexes', array());
  if (empty($indexes[$this->bin])) {
    $indexes[$this->bin] = 1;

    // Initial index value.
    MemcacheStorageAPI::set('memcache_storage_bin_indexes', $indexes, CACHE_PERMANENT);
  }
  return $indexes[$this->bin];
}