/**
  * Clean cache by tags
  *
  * @param  string[] $tags
  * @return void
  */
 private function cleanCacheByTags($tags)
 {
     if (empty($tags)) {
         return;
     }
     foreach ($this->cacheList as $cacheType) {
         if ($this->cacheState->isEnabled($cacheType)) {
             $this->cachePool->get($cacheType)->clean(\Zend_Cache::CLEANING_MODE_MATCHING_TAG, array_unique($tags));
         }
     }
 }
示例#2
0
 /**
  * Get array of all invalidated cache types
  *
  * @return array
  */
 public function getInvalidated()
 {
     $invalidatedTypes = [];
     $types = $this->_getInvalidatedTypes();
     if ($types) {
         $allTypes = $this->getTypes();
         foreach (array_keys($types) as $type) {
             if (isset($allTypes[$type]) && $this->_cacheState->isEnabled($type)) {
                 $invalidatedTypes[$type] = $allTypes[$type];
             }
         }
     }
     return $invalidatedTypes;
 }