You are here

function d8cache_cache_tags_get_current_checksum in Drupal 8 Cache Backport 7

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.

1 call to d8cache_cache_tags_get_current_checksum()
D8Cache::getCurrentChecksum in ./d8cache.cache.inc
Returns the sum total of validations for a given set of tags.

File

./d8cache.module, line 234
Main module file for the D8 caching system backport.

Code

function d8cache_cache_tags_get_current_checksum(array $tags) {
  $invalidated_tags =& drupal_static('d8cache_invalidated_tags', array());

  // Remove tags that were already invalidated during this request from the
  // static caches so that another invalidation can occur later in the same
  // request. Without that, written cache items would not be invalidated
  // correctly.
  foreach ($tags as $tag) {
    unset($invalidated_tags[$tag]);
  }
  return _d8cache_cache_tags_calculate_checksum($tags);
}