每天laravel-20160628|TaggedCache
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了每天laravel-20160628|TaggedCache相关的知识,希望对你有一定的参考价值。
<?php namespace Illuminate\Cache; use Illuminate\Contracts\Cache\Store; // a namespace about Store; class TaggedCache extends Repository {// TaggedCache a son about the Repository, use RetrievesMultipleKeys;// use a way to many too /** * The tag set instance. * The tag set instance. * @var \Illuminate\Cache\TagSet */ protected $tags;// a tag to set the instance /** * Create a new tagged cache instance. * * @param \Illuminate\Contracts\Cache\Store $store * @param \Illuminate\Cache\TagSet $tags * @return void */ public function __construct(Store $store, TagSet $tags) { parent::__construct($store); $this->tags = $tags; }// Create a new tagged cache instance. // use parent::__construct($store) // create a tag by tags. /** * {@inheritdoc} */ protected function fireCacheEvent($event, $payload) {// fire Cache Event $payload[] = $this->tags->getNames();// get the tag payLoad area parent::fireCacheEvent($event, $payload); }// use parent function fire Cache Event /** * Increment the value of an item in the cache. * * @param string $key * @param mixed $value * @return void */ public function increment($key, $value = 1) { $this->store->increment($this->itemKey($key), $value); }// Increment the value of an item in the cache. // increment a key, like value++ /** * Increment the value of an item in the cache. * * @param string $key * @param mixed $value * @return void */ public function decrement($key, $value = 1) { $this->store->decrement($this->itemKey($key), $value); }// decrement the value about key /** * Remove all items from the cache. * * @return void */ public function flush() { $this->tags->reset(); }// Remove all items from the cache. /** * {@inheritdoc} */ protected function itemKey($key) { return $this->taggedItemKey($key); }// get item Key /** * Get a fully qualified key for a tagged item. * * @param string $key * @return string */ public function taggedItemKey($key) { return sha1($this->tags->getNamespace()).‘:‘.$key; }// get a fully qualified key for a tagged item. }
本文出自 “专注php” 博客,请务必保留此出处http://lijinghsan.blog.51cto.com/3357095/1759952
以上是关于每天laravel-20160628|TaggedCache的主要内容,如果未能解决你的问题,请参考以下文章
每天laravel-20160629|RedisTaggedCache
javascript tagged_template_literals
javascript tagged_template_literals.js
未找到带有参数 '('',)' 的 'tagged' 的反向操作。尝试了 1 种模式:['^tag/(?P<slug>[-\w]+)/$']