clearTag() публичный статический Метод

Removes entries from the cache matching the given tag
public static clearTag ( string $tag ) : void
$tag string
Результат void
Пример #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();
     }
 }
Пример #2
0
 /**
  * @return void
  */
 public function clearDependentCache()
 {
     \Pimcore\Cache::clearTag("website_config");
 }
Пример #3
0
 /**
  * @return void
  */
 public function delete()
 {
     // empty object cache
     try {
         Cache::clearTag("customlayout_" . $this->getId());
     } catch (\Exception $e) {
     }
     // empty output cache
     try {
         Cache::clearTag("output");
     } catch (\Exception $e) {
     }
     $this->getDao()->delete();
 }
Пример #4
0
 public function glossaryAction()
 {
     if ($this->getParam("data")) {
         $this->checkPermission("glossary");
         Cache::clearTag("glossary");
         if ($this->getParam("xaction") == "destroy") {
             $data = \Zend_Json::decode($this->getParam("data"));
             if (\Pimcore\Tool\Admin::isExtJS6()) {
                 $id = $data["id"];
             } else {
                 $id = $data;
             }
             $glossary = Glossary::getById($id);
             $glossary->delete();
             $this->_helper->json(array("success" => true, "data" => array()));
         } else {
             if ($this->getParam("xaction") == "update") {
                 $data = \Zend_Json::decode($this->getParam("data"));
                 // save glossary
                 $glossary = Glossary::getById($data["id"]);
                 if ($data["link"]) {
                     if ($doc = Document::getByPath($data["link"])) {
                         $tmpLink = $data["link"];
                         $data["link"] = $doc->getId();
                     }
                 }
                 $glossary->setValues($data);
                 $glossary->save();
                 if ($link = $glossary->getLink()) {
                     if (intval($link) > 0) {
                         if ($doc = Document::getById(intval($link))) {
                             $glossary->setLink($doc->getFullPath());
                         }
                     }
                 }
                 $this->_helper->json(array("data" => $glossary, "success" => true));
             } else {
                 if ($this->getParam("xaction") == "create") {
                     $data = \Zend_Json::decode($this->getParam("data"));
                     unset($data["id"]);
                     // save glossary
                     $glossary = new Glossary();
                     if ($data["link"]) {
                         if ($doc = Document::getByPath($data["link"])) {
                             $tmpLink = $data["link"];
                             $data["link"] = $doc->getId();
                         }
                     }
                     $glossary->setValues($data);
                     $glossary->save();
                     if ($link = $glossary->getLink()) {
                         if (intval($link) > 0) {
                             if ($doc = Document::getById(intval($link))) {
                                 $glossary->setLink($doc->getFullPath());
                             }
                         }
                     }
                     $this->_helper->json(array("data" => $glossary, "success" => true));
                 }
             }
         }
     } else {
         // get list of glossaries
         $list = new Glossary\Listing();
         $list->setLimit($this->getParam("limit"));
         $list->setOffset($this->getParam("start"));
         $sortingSettings = \Pimcore\Admin\Helper\QueryParams::extractSortingSettings($this->getAllParams());
         if ($sortingSettings['orderKey']) {
             $list->setOrderKey($sortingSettings['orderKey']);
             $list->setOrder($sortingSettings['order']);
         }
         if ($this->getParam("filter")) {
             $list->setCondition("`text` LIKE " . $list->quote("%" . $this->getParam("filter") . "%"));
         }
         $list->load();
         $glossaries = array();
         foreach ($list->getGlossary() as $glossary) {
             if ($link = $glossary->getLink()) {
                 if (intval($link) > 0) {
                     if ($doc = Document::getById(intval($link))) {
                         $glossary->setLink($doc->getFullPath());
                     }
                 }
             }
             $glossaries[] = $glossary;
         }
         $this->_helper->json(array("data" => $glossaries, "success" => true, "total" => $list->getTotalCount()));
     }
     $this->_helper->json(false);
 }
Пример #5
0
 /**
  * @return void
  */
 public function clearDependentCache()
 {
     // this is mostly called in Redirect\Dao not here
     try {
         \Pimcore\Cache::clearTag("redirect");
     } catch (\Exception $e) {
         Logger::crit($e);
     }
 }
Пример #6
0
 /**
  * @return void
  */
 public function delete()
 {
     // delete all objects using this class
     $list = new Listing();
     $list->setCondition("o_classId = ?", $this->getId());
     $list->load();
     foreach ($list->getObjects() as $o) {
         $o->delete();
     }
     $this->deletePhpClasses();
     // empty object cache
     try {
         Cache::clearTag("class_" . $this->getId());
     } catch (\Exception $e) {
     }
     // empty output cache
     try {
         Cache::clearTag("output");
     } catch (\Exception $e) {
     }
     $customLayouts = new ClassDefinition\CustomLayout\Listing();
     $customLayouts->setCondition("classId = " . $this->getId());
     $customLayouts = $customLayouts->load();
     foreach ($customLayouts as $customLayout) {
         $customLayout->delete();
     }
     $this->getDao()->delete();
 }
Пример #7
0
 /**
  * @return void
  */
 public function clearDependentCache()
 {
     // this is mostly called in Staticroute\Dao not here
     try {
         \Pimcore\Cache::clearTag("staticroute");
     } catch (\Exception $e) {
         \Logger::crit($e);
     }
 }