저자: XE Developers (developers@xpressengine.com)
예제 #1
0
 /**
  * Remove cache data
  *
  * @param string $key config name
  * @return void
  */
 protected function erase($key)
 {
     $segments = explode('.', $key);
     $head = reset($segments);
     if ($key == $head) {
         $this->cache->forget($this->getCacheKey($head));
     } else {
         $cache = $this->make($this->getAll($head), $segments, null);
         $this->cache->put($this->getCacheKey($head), $cache);
     }
     foreach ($this->bag as $k => $item) {
         if (substr($k, 0, strlen($key)) == $key) {
             unset($this->bag[$k]);
         }
     }
 }
예제 #2
0
 /**
  * Delete the route item from the repository
  *
  * @param InstanceRoute $route route instance
  * @return bool|null
  */
 public function delete(InstanceRoute $route)
 {
     $this->cache->forget($this->getCacheKey($route->siteKey . '_' . $route->url));
     $this->cache->forget($this->getCacheKey($route->instanceId));
     return $this->repo->delete($route);
 }
예제 #3
0
 /**
  * Delete menu item
  *
  * @param MenuItem $item menu item instance
  * @return bool
  */
 public function deleteItem(MenuItem $item)
 {
     $this->cache->forget($this->getCacheKey($item->menu->getKey()));
     return $this->repo->deleteItem($item);
 }
예제 #4
0
 /**
  * Remove an item from the cache.
  *
  * @param Permission $item permission instance
  * @return void
  */
 protected function forget(Permission $item)
 {
     $this->cache->forget($this->getCacheKey($item->siteKey, $item->name));
     $this->cache->forget($this->getCacheKey($item->siteKey, $item->name, 'ancestor'));
     $this->cache->forget($this->getCacheKey($item->siteKey, $item->name, 'descendant'));
 }
예제 #5
0
 /**
  * Delete menu item
  *
  * @param MenuItem $item menu item instance
  * @return bool
  */
 public function deleteItem(MenuItem $item)
 {
     $key = $this->getItemCacheKey($item->getKey());
     $this->cache->forget($key);
     return $this->repo->deleteItem($item);
 }
예제 #6
0
 /**
  * Remove cache data
  *
  * @param string $siteKey site key
  * @param string $name    config name
  * @return void
  */
 protected function erase($siteKey, $name)
 {
     $key = $this->makeKey($siteKey, $this->getHead($name));
     unset($this->bag[$key]);
     $this->cache->forget($this->getCacheKey($key));
 }