当前位置: 首页>>代码示例>>PHP>>正文


PHP Cache::clearTag方法代码示例

本文整理汇总了PHP中Pimcore\Model\Cache::clearTag方法的典型用法代码示例。如果您正苦于以下问题:PHP Cache::clearTag方法的具体用法?PHP Cache::clearTag怎么用?PHP Cache::clearTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pimcore\Model\Cache的用法示例。


在下文中一共展示了Cache::clearTag方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateIndex

 /**
  * Runs update index for all tenants
  *  - but does not run processPreparationQueue or processUpdateIndexQueue
  *
  * @param $objectListClass
  * @param string $condition
  * @param bool $updateIndexStructures
  * @param string $loggername
  */
 public static function updateIndex($objectListClass, $condition = "", $updateIndexStructures = false, $loggername = "indexupdater")
 {
     $updater = OnlineShop_Framework_Factory::getInstance()->getIndexService();
     if ($updateIndexStructures) {
         \Pimcore\Model\Cache::clearTag("ecommerceconfig");
         $updater->createOrUpdateIndexStructures();
     }
     $page = 0;
     $pageSize = 100;
     $count = $pageSize;
     while ($count > 0) {
         self::log($loggername, "=========================");
         self::log($loggername, "Update Index Page: " . $page);
         self::log($loggername, "=========================");
         $products = new $objectListClass();
         $products->setUnpublished(true);
         $products->setOffset($page * $pageSize);
         $products->setLimit($pageSize);
         $products->setObjectTypes(array("object", "folder", "variant"));
         $products->setIgnoreLocalizedFields(true);
         $products->setCondition($condition);
         foreach ($products as $p) {
             self::log($loggername, "Updating product " . $p->getId());
             $updater->updateIndex($p);
         }
         $page++;
         $count = count($products->getObjects());
         Pimcore::collectGarbage();
     }
 }
开发者ID:ascertain,项目名称:NGshop,代码行数:39,代码来源:IndexUpdater.php

示例2: glossaryAction

 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::isExtJS5()) {
                 $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"));
         if ($this->getParam("sort")) {
             $list->setOrderKey($this->getParam("sort"));
             $list->setOrder($this->getParam("dir"));
         }
         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);
 }
开发者ID:pawansgi92,项目名称:pimcore2,代码行数:89,代码来源:SettingsController.php

示例3: clearDependentCache

 /**
  * @return void
  */
 public function clearDependentCache()
 {
     // this is mostly called in Redirect\Resource not here
     try {
         \Pimcore\Model\Cache::clearTag("redirect");
     } catch (\Exception $e) {
         \Logger::crit($e);
     }
 }
开发者ID:Gerhard13,项目名称:pimcore,代码行数:12,代码来源:Redirect.php

示例4: clearCacheAction

 public function clearCacheAction()
 {
     \Pimcore\Model\Cache::clearTag("ecommerceconfig");
     exit;
 }
开发者ID:ascertain,项目名称:NGshop,代码行数:5,代码来源:AdminController.php

示例5: delete

 /**
  * @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->getResource()->delete();
 }
开发者ID:rolandstoll,项目名称:pimcore,代码行数:17,代码来源:CustomLayout.php

示例6: delete

 /**
  * @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();
 }
开发者ID:ChristophWurst,项目名称:pimcore,代码行数:31,代码来源:ClassDefinition.php


注:本文中的Pimcore\Model\Cache::clearTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。