You are here

function _d8cache_cache_tags_load_from_cache in Drupal 8 Cache Backport 7

Loads cache tag invalidations from the cache.

Parameters

array &$query_tags: The tags to query in the cache. Will be updated by removing tags sucessfully returned from cache.

Return value

array An array keyed by tag with invalidations as value.

1 call to _d8cache_cache_tags_load_from_cache()
_d8cache_cache_tags_calculate_checksum in ./d8cache.module
Calculates the current checksum for a given set of tags.

File

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

Code

function _d8cache_cache_tags_load_from_cache(&$query_tags) {
  if (!variable_get('d8cache_use_cache_tags_cache', FALSE)) {
    return array();
  }
  $result = array();

  // Load from cache.
  $cached = cache_get_multiple($query_tags, 'cache_d8cache_cache_tags');
  foreach ($cached as $tag => $item) {
    $result[$tag] = $item->data;
  }
  return $result;
}