當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CacheManager::tags方法代碼示例

本文整理匯總了PHP中Illuminate\Cache\CacheManager::tags方法的典型用法代碼示例。如果您正苦於以下問題:PHP CacheManager::tags方法的具體用法?PHP CacheManager::tags怎麽用?PHP CacheManager::tags使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Cache\CacheManager的用法示例。


在下文中一共展示了CacheManager::tags方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: has

 /**
  * 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);
 }
開發者ID:MehmetNuri,項目名稱:fullycms,代碼行數:12,代碼來源:FullyCache.php

示例2: cache

 /**
  * 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);
 }
開發者ID:pavankumarkatakam,項目名稱:jwt-auth,代碼行數:12,代碼來源:IlluminateCacheAdapter.php

示例3: loadInventory

 /**
  * 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;
 }
開發者ID:invisnik,項目名稱:laravel-steam-inventory,代碼行數:25,代碼來源:SteamInventory.php

示例4: flush

 /**
  * 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();
 }
開發者ID:raditv,項目名稱:laravel-repository,代碼行數:16,代碼來源:LaravelCache.php

示例5: getCache

 /**
  * 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);
 }
開發者ID:torann,項目名稱:snazzy-twig,代碼行數:18,代碼來源:Core.php

示例6: has

 /**
  * Has
  *
  * @param string $key
  * @return bool
  */
 public function has($key)
 {
     return $this->cache->tags($this->tag)->has($key);
 }
開發者ID:psychonetic,項目名稱:BlogExample-with-Laravel-5,代碼行數:10,代碼來源:LaravelCache.php

示例7: cacheTags

 /**
  * @return mixed
  */
 public function cacheTags()
 {
     return $this->cache->tags($this->tag);
 }
開發者ID:draperstudio,項目名稱:eloquent-repositories,代碼行數:7,代碼來源:CacheManager.php

示例8: flush

 /**
  * @return void
  */
 public function flush()
 {
     $this->cache->tags($this->cacheKey)->flush();
 }
開發者ID:laravel-jp-reference,項目名稱:chapter8,代碼行數:7,代碼來源:DataCache.php

示例9: forgetByTags

 public function forgetByTags($tags)
 {
     return $this->cache->tags($tags)->flush();
 }
開發者ID:vinelab,項目名稱:agency,代碼行數:4,代碼來源:CacheManager.php


注:本文中的Illuminate\Cache\CacheManager::tags方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。