You are here

public function DummyTagChecksum::getCurrentChecksum in Supercache 2.0.x

Same name and namespace in other branches
  1. 8 src/Cache/DummyTagChecksum.php \Drupal\supercache\Cache\DummyTagChecksum::getCurrentChecksum()

Returns the sum total of validations for a given set of tags.

Called by a backend when storing a cache item.

Parameters

string[] $tags: Array of cache tags.

Return value

string Cache tag invalidations checksum.

Overrides CacheTagsChecksumInterface::getCurrentChecksum

File

src/Cache/DummyTagChecksum.php, line 22
Contains \Drupal\supercache\Cache\DummyTagChecksum.

Class

DummyTagChecksum
Stub checksum interface, for when you need to use a cache backend without tag invalidation support.

Namespace

Drupal\supercache\Cache

Code

public function getCurrentChecksum(array $tags) {
  if (!empty($tags)) {
    throw new \Exception("DummyTagChecksum cannot process tags.");
  }

  // Checksum needs to be 0 because the original
  // database storage for tags was designed not
  // to accept NULL.
  return 0;
}