function d8cache_cache_tags_is_valid in Drupal 8 Cache Backport 7
Returns whether the checksum is valid for the given cache tags.
Used when retrieving a cache item in a cache backend, to verify that no cache tag based invalidation happened.
Parameters
int $checksum: The checksum that was stored together with the cache item.
string[] $tags: The cache tags that were stored together with the cache item.
Return value
bool FALSE if cache tag invalidations happened for the passed in tags since the cache item was stored, TRUE otherwise.
1 call to d8cache_cache_tags_is_valid()
- D8Cache::checksumValid in ./
d8cache.cache.inc - Returns whether the checksum is valid for the given cache tags.
File
- ./
d8cache.module, line 263 - Main module file for the D8 caching system backport.
Code
function d8cache_cache_tags_is_valid($checksum, array $tags) {
return $checksum == _d8cache_cache_tags_calculate_checksum($tags);
}