clearTags() public static method

Removes entries from the cache matching the given tags
public static clearTags ( array $tags = [] ) : void
$tags array
return void
Example #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if ($input->getOption("tags")) {
         $tags = explode(",", $input->getOption("tags"));
         Cache::clearTags($tags);
     } elseif ($input->getOption("output")) {
         Cache::clearTag("output");
     } else {
         Cache::clearAll();
     }
 }
Example #2
0
 /** Clears the column information for the given table.
  * @param $table
  */
 protected function resetValidTableColumnsCache($table)
 {
     $cacheKey = self::CACHEKEY . $table;
     \Zend_Registry::getInstance()->offsetUnset($cacheKey);
     Cache::clearTags(array("system", "resource"));
 }
Example #3
0
 /**
  * @param array $additionalTags
  */
 public function clearDependentCache($additionalTags = [])
 {
     try {
         $tags = ["object_" . $this->getId(), "object_properties", "output"];
         $tags = array_merge($tags, $additionalTags);
         Cache::clearTags($tags);
     } catch (\Exception $e) {
         \Logger::crit($e);
     }
 }
Example #4
0
 /**
  * @return void
  */
 public static function clearDependentCache()
 {
     \Pimcore\Cache::clearTags(["translator", "translate"]);
 }
Example #5
0
 /**
  * @return void
  */
 public function delete()
 {
     $this->getDao()->delete();
     // clear cache tags
     Cache::clearTags(array("tagmanagement", "output"));
 }
Example #6
0
 public function clearOutputCacheAction()
 {
     $this->checkPermission("clear_cache");
     // remove "output" out of the ignored tags, if a cache lifetime is specified
     Cache::removeIgnoredTagOnClear("output");
     // empty document cache
     Cache::clearTags(["output", "output_lifetime"]);
     \Pimcore::getEventManager()->trigger("system.cache.clearOutputCache", $this);
     $this->_helper->json(["success" => true]);
 }
Example #7
0
 /**
  * @return void
  */
 public function delete()
 {
     if (is_file($this->getConfigFile())) {
         unlink($this->getConfigFile());
     }
     // clear cache tags
     Cache::clearTags(array("tagmanagement", "output"));
 }
Example #8
0
 public function cleanupAction()
 {
     $listClass = "\\Pimcore\\Model\\Translation\\" . ucfirst($this->getParam("type")) . "\\Listing";
     if (Tool::classExists($listClass)) {
         $list = new $listClass();
         $list->cleanup();
         \Pimcore\Cache::clearTags(array("translator", "translate"));
         $this->_helper->json(array("success" => true));
     }
     $this->_helper->json(array("success" => false));
 }
Example #9
0
 /**
  * @param array $additionalTags
  */
 public function clearDependentCache($additionalTags = array())
 {
     try {
         $tags = array("document_" . $this->getId(), "document_properties", "output");
         $tags = array_merge($tags, $additionalTags);
         \Pimcore\Cache::clearTags($tags);
     } catch (\Exception $e) {
         \Logger::crit($e);
     }
 }