Example #1
0
 /**
  * Removes the given cache entry from the cache.
  *
  * @param string $entryIdentifier An identifier specifying the cache entry
  * @return bool TRUE if such an entry exists, FALSE if not
  * @throws \InvalidArgumentException
  * @api
  */
 public function remove($entryIdentifier)
 {
     if (!$this->isValidEntryIdentifier($entryIdentifier)) {
         throw new \InvalidArgumentException('"' . $entryIdentifier . '" is not a valid cache entry identifier.', 1233058495);
     }
     return $this->backend->remove($entryIdentifier);
 }
 /**
  * @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();
 }
 /**
  * Clears cache content (for $this->newHash)
  *
  * @return void
  * @todo Define visibility
  */
 public function clearPageCacheContent()
 {
     $this->pageCache->remove($this->newHash);
 }