/**
  * @param array $pageHashs
  */
 protected function flushCacheByHashIdentifiersImplementation(&$pageHashs)
 {
     if (is_array($pageHashs) && count($pageHashs)) {
         foreach ($pageHashs as $pageHash) {
             if (substr($pageHash, 0, 3) == 'id-') {
                 $pageId = substr($pageHash, 3);
                 $this->pageCache->flushByTag('pageId_' . $pageId);
                 if ($this->ncStaticFileCache) {
                     $params = array('cacheCmd' => $pageId);
                     $this->ncStaticFileCache->clearStaticFile($params);
                 }
             } elseif (substr($pageHash, 0, 5) == 'hash-') {
                 $identifier = substr($pageHash, 5);
                 $this->pageCache->remove($identifier);
                 if ($this->ncStaticFileCache) {
                     $this->ncStaticFileCache->deleteStaticCacheByIdentifier($identifier);
                 }
             }
         }
     }
     $pageHashs = array();
 }
Example #2
0
 /**
  * Removes all cache entries of this cache which are tagged by the specified tag.
  *
  * @param string $tag The tag the entries must have
  * @return void
  * @throws \InvalidArgumentException
  * @api
  */
 public function flushByTag($tag)
 {
     if (!$this->isValidTag($tag)) {
         throw new \InvalidArgumentException('"' . $tag . '" is not a valid tag for a cache entry.', 1233057359);
     }
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_abstractfrontend.php']['flushByTag'])) {
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_abstractfrontend.php']['flushByTag'] as $_funcRef) {
             $params = array('tag' => $tag);
             GeneralUtility::callUserFunction($_funcRef, $params, $this);
         }
     }
     if ($this->backend instanceof TaggableBackendInterface) {
         $this->backend->flushByTag($tag);
     }
 }
 /**
  * Clears cache content for a list of page ids
  *
  * @param string $pidList A list of INTEGER numbers which points to page uids for which to clear entries in the cache_pages cache (page content cache)
  * @return void
  * @todo Define visibility
  */
 public function clearPageCacheContent_pidList($pidList)
 {
     $pageIds = GeneralUtility::trimExplode(',', $pidList);
     foreach ($pageIds as $pageId) {
         $this->pageCache->flushByTag('pageId_' . (int) $pageId);
     }
 }