本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例6: has
/**
* Has
*
* @param string $key
* @return bool
*/
public function has($key)
{
return $this->cache->tags($this->tag)->has($key);
}
示例7: cacheTags
/**
* @return mixed
*/
public function cacheTags()
{
return $this->cache->tags($this->tag);
}
示例8: flush
/**
* @return void
*/
public function flush()
{
$this->cache->tags($this->cacheKey)->flush();
}
示例9: forgetByTags
public function forgetByTags($tags)
{
return $this->cache->tags($tags)->flush();
}