RedisTaggedCache
class RedisTaggedCache extends TaggedCache
Traits
Constants
REFERENCE_KEY_FOREVER |
Forever reference key. |
REFERENCE_KEY_STANDARD |
Standard reference key. |
Properties
static protected array | $macros | The registered string macros. |
from Macroable |
protected Store | $store | The cache store implementation. |
from Repository |
protected Dispatcher | $events | The event dispatcher implementation. |
from Repository |
protected float|int | $default | The default number of minutes to store items. |
from Repository |
protected TagSet | $tags | The tag set instance. |
from TaggedCache |
Methods
Dynamically handle calls to the class.
Dynamically handle calls to the class.
Retrieve an item from the cache by key.
Handle a result for the "many" method.
Retrieve an item from the cache and delete it.
Store multiple items in the cache for a given number of minutes.
Store an item in the cache if the key does not exist.
Increment the value of an item in the cache.
Increment the value of an item in the cache.
Store an item in the cache indefinitely.
Get an item from the cache, or store the default value.
Get an item from the cache, or store the default value forever.
Get an item from the cache, or store the default value forever.
Begin executing a new tags operation if the store supports it.
Set the default cache time in minutes.
Store an item in the cache for the default time.
Remove all items from the cache.
Store standard key references into store.
Store forever key references into store.
Store a reference to the cache key against the reference key.
Delete all of the items that were stored forever.
Delete all standard items.
Find and delete all of the items that were stored against a reference.
Delete item keys that have been stored against a reference.
Get the reference key for the segment.
Details
in
Macroable at line 24
static void
macro(string $name, callable $macro)
Register a custom macro.
in
Macroable at line 35
static bool
hasMacro(string $name)
Checks if macro is registered.
in
Macroable at line 49
static mixed
__callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
in
Macroable at line 71
mixed
__call(string $method, array $parameters)
Dynamically handle calls to the class.
in
TaggedCache at line 25
void
__construct(Store $store, TagSet $tags)
Create a new tagged cache instance.
in
Repository at line 66
bool
has(string $key)
Determine if an item exists in the cache.
in
Repository at line 78
mixed
get(string $key, mixed $default = null)
Retrieve an item from the cache by key.
in
RetrievesMultipleKeys at line 15
array
many(array $keys)
Retrieve multiple items from the cache by key.
Items not found in the cache will have a null value.
in
Repository at line 127
protected mixed
handleManyResult(array $keys, string $key, mixed $value)
Handle a result for the "many" method.
in
Repository at line 153
mixed
pull(string $key, mixed $default = null)
Retrieve an item from the cache and delete it.
at line 28
void
put(string $key, mixed $value, DateTime|float|int $minutes = null)
Store an item in the cache.
in
RetrievesMultipleKeys at line 33
void
putMany(array $values, float|int $minutes)
Store multiple items in the cache for a given number of minutes.
in
Repository at line 207
bool
add(string $key, mixed $value, DateTime|float|int $minutes)
Store an item in the cache if the key does not exist.
in
TaggedCache at line 39
int|bool
increment(string $key, mixed $value = 1)
Increment the value of an item in the cache.
in
TaggedCache at line 51
int|bool
decrement(string $key, mixed $value = 1)
Increment the value of an item in the cache.
at line 42
void
forever(string $key, mixed $value)
Store an item in the cache indefinitely.
in
Repository at line 280
mixed
remember(string $key, DateTime|float|int $minutes, Closure $callback)
Get an item from the cache, or store the default value.
in
Repository at line 303
mixed
sear(string $key, Closure $callback)
Get an item from the cache, or store the default value forever.
in
Repository at line 315
mixed
rememberForever(string $key, Closure $callback)
Get an item from the cache, or store the default value forever.
in
Repository at line 337
bool
forget(string $key)
Remove an item from the cache.
in
Repository at line 352
TaggedCache
tags(array|mixed $names)
Begin executing a new tags operation if the store supports it.
in
TaggedCache at line 69
protected string
itemKey(string $key)
Format the key for a cache item.
in
Repository at line 383
float|int
getDefaultCacheTime()
Get the default cache time.
in
Repository at line 394
$this
setDefaultCacheTime(float|int $minutes)
Set the default cache time in minutes.
in
Repository at line 406
Store
getStore()
Get the cache store implementation.
in
TaggedCache at line 91
protected void
event(string $event)
Fire an event for this cache instance.
in
Repository at line 430
void
setEventDispatcher(Dispatcher $events)
Set the event dispatcher instance.
in
Repository at line 441
bool
offsetExists(string $key)
Determine if a cached value exists.
in
Repository at line 452
mixed
offsetGet(string $key)
Retrieve an item from the cache by key.
in
Repository at line 464
void
offsetSet(string $key, mixed $value)
Store an item in the cache for the default time.
in
Repository at line 475
void
offsetUnset(string $key)
Remove an item from the cache.
in
Repository at line 486
protected float|int|null
getMinutes(DateTime|float|int $duration)
Calculate the number of minutes with the given duration.
in
Repository at line 516
void
__clone()
Clone cache repository instance.
at line 54
void
flush()
Remove all items from the cache.
in
TaggedCache at line 80
string
taggedItemKey(string $key)
Get a fully qualified key for a tagged item.
at line 69
protected void
pushStandardKeys(string $namespace, string $key)
Store standard key references into store.
at line 81
protected void
pushForeverKeys(string $namespace, string $key)
Store forever key references into store.
at line 94
protected void
pushKeys(string $namespace, string $key, string $reference)
Store a reference to the cache key against the reference key.
at line 108
protected void
deleteForeverKeys()
Delete all of the items that were stored forever.
at line 118
protected void
deleteStandardKeys()
Delete all standard items.
at line 129
protected void
deleteKeysByReference(string $reference)
Find and delete all of the items that were stored against a reference.
at line 144
protected void
deleteValues(string $referenceKey)
Delete item keys that have been stored against a reference.
at line 162
protected string
referenceKey(string $segment, string $suffix)
Get the reference key for the segment.