コード例 #1
0
ファイル: FullyCache.php プロジェクト: MehmetNuri/fullycms
 /**
  * Has
  * @param $key
  * @return bool
  */
 public function has($key)
 {
     if ($this->cacheDriver == "file") {
         return $this->cache->has($key);
     }
     return $this->cache->tags($this->tag)->has($key);
 }
コード例 #2
0
 /**
  * Return the cache instance with tags attached
  *
  * @return \Illuminate\Cache\CacheManager
  */
 protected function cache()
 {
     if (!method_exists($this->cache, 'tags')) {
         return $this->cache;
     }
     return $this->cache->tags($this->tag);
 }
コード例 #3
0
 /**
  * Load the inventory for a Steam ID
  *
  * @param  integer $steamId
  * @param  integer $appId
  * @param  integer $contextId
  * @return Json
  */
 public function loadInventory($steamId, $appId = 730, $contextId = 2)
 {
     if ($this->cache->tags($this->cacheTag)->has($steamId)) {
         $this->currentData = $this->cache->tags($this->cacheTag)->get($steamId);
         // Return the cached data
         return $this;
     }
     $inventory = $this->getSteamInventory($steamId, $appId, $contextId);
     if (is_array($inventory)) {
         $minutes = $this->cacheTime;
         $this->cache->tags($this->cacheTag)->put($steamId, $inventory, $minutes);
         $this->currentData = $inventory;
     } else {
         return false;
     }
     return $this;
 }
コード例 #4
0
 /**
  * Flush cache for tags.
  *
  * @param  mixed $tags
  *
  * @return bool
  */
 public function flush($tags = null)
 {
     if ($tags !== null) {
         $tags = is_array($tags) ? $tags : func_get_args();
     } else {
         $tags = $this->tags;
     }
     return $this->cache->tags($tags)->flush();
 }
コード例 #5
0
ファイル: Core.php プロジェクト: torann/snazzy-twig
 /**
  * Get an item from the cache manager, or store the default value.
  *
  * @param  string   $key
  * @param  \Closure $callback
  *
  * @return mixed
  */
 public function getCache($key, Closure $callback)
 {
     // Skip cache for development
     if (config('app.debug')) {
         return $this->getLocalCache($key, $callback);
     }
     $key = $this->website->id . '-' . $key;
     $tags = $this->getCacheTags('pages');
     return $this->cacheManager->tags($tags)->rememberForever($key, $callback);
 }
コード例 #6
0
 /**
  * Has
  *
  * @param string $key
  * @return bool
  */
 public function has($key)
 {
     return $this->cache->tags($this->tag)->has($key);
 }
コード例 #7
0
 /**
  * @return mixed
  */
 public function cacheTags()
 {
     return $this->cache->tags($this->tag);
 }
コード例 #8
0
 /**
  * @return void
  */
 public function flush()
 {
     $this->cache->tags($this->cacheKey)->flush();
 }
コード例 #9
0
ファイル: CacheManager.php プロジェクト: vinelab/agency
 public function forgetByTags($tags)
 {
     return $this->cache->tags($tags)->flush();
 }