Ejemplo n.º 1
0
 /**
  * vymaze cache data konkretni URL pricemz si sam zkontroluje, jestli ma byt stranka na teto URL promazana jen pro momentalne zalogovaneho uzivatele
  * @param string $url
  * @param bool $forceCleanForAllXTUsers
  */
 public function cleanURLData($url = "", $forceCleanForAllXTUsers = false)
 {
     try {
         if (strlen($url) < 1) {
             throw new LBoxExceptionCache(LBoxExceptionCache::MSG_PARAM_STRING_NOTNULL, LBoxExceptionCache::CODE_BAD_PARAM);
         }
         if (!array_key_exists($url, (array) $this->recordTypes)) {
             return;
         }
         $config = LBoxConfigManagerStructure::getInstance()->getPageById($this->recordTypes[$url]["pageid"]);
         if (!$forceCleanForAllXTUsers && !LBoxXTProject::isLoggedAdmin() && $config->cache_by_xtuser) {
             LBoxCacheFront::getInstance("", "", $this->isPageCachedByXTUserByURL($url))->removeConcrete(LBoxCacheFront::getCacheID(), $url);
         } else {
             if ($this->isPageCachedByXTUserByURL($url)) {
                 LBoxCacheFront::getInstance("", "", $this->isPageCachedByXTUserByURL($url))->cleanConcrete($url);
             } else {
                 LBoxCacheFront::getInstance($url, LBoxCacheFront::getCacheID(), $this->isPageCachedByXTUserByURL($url))->removeConcrete();
             }
         }
     } catch (Exception $e) {
         throw $e;
     }
 }