You are here

function DrupalAPCCache::isEmpty in APC - Alternative PHP Cache 7

Checks if a cache bin is empty.

A cache bin is considered empty if it does not contain any valid data for any cache ID.

Return value

TRUE if the cache bin specified is empty.

Overrides DrupalCacheInterface::isEmpty

File

./drupal_apc_cache.inc, line 294
This integrates the drupal APC cache backend.

Class

DrupalAPCCache
APC cache implementation.

Code

function isEmpty() {
  if (class_exists('APCIterator')) {
    $iterator = new APCIterator('user', '/^\\Q' . $this
      ->binKey() . '\\E/', APC_ITER_KEY);
    return 0 === $iterator
      ->getTotalCount();
  }
  return TRUE;
}