예제 #1
0
 /**
  * Return the cache instance with tags attached.
  *
  * @return \Illuminate\Contracts\Cache\Repository|\Illuminate\Contracts\Cache\Store
  */
 protected function cache()
 {
     if (!method_exists($this->cache, 'tags')) {
         return $this->cache;
     }
     return $this->cache->tags($this->tag);
 }
예제 #2
0
 /**
  * @param UrlGenerator $url
  * @param Store        $cache
  * @param null         $publicFolder
  */
 public function __construct(UrlGenerator $url, Store $cache, $publicFolder = null)
 {
     $this->url = $url;
     $this->cache = $cache;
     if (method_exists($this->cache, 'tags')) {
         $this->cache = $cache->tags('arrounded.meta');
     }
     $this->publicFolder = $publicFolder;
 }
예제 #3
0
 /**
  * Begin executing a new tags operation if the store supports it.
  *
  * @param array|mixed $names        	
  * @return \Illuminate\Cache\TaggedCache
  *
  * @throws \BadMethodCallException
  */
 public function tags($names)
 {
     if (method_exists($this->store, 'tags')) {
         $taggedCache = $this->store->tags($names);
         if (!is_null($this->events)) {
             $taggedCache->setEventDispatcher($this->events);
         }
         $taggedCache->setDefaultCacheTime($this->default);
         return $taggedCache;
     }
     throw new BadMethodCallException('This cache store does not support tagging.');
 }
예제 #4
0
 /**
  *  Completely clear the cache
  *
  *  @return void
  */
 public function clear()
 {
     $this->store->tags([$this->cacheTag])->flush();
 }