RedisStore
class RedisStore extends TaggableStore implements LockProvider (View source)
Traits
Properties
protected Factory | $redis | The Redis factory implementation. |
|
protected string | $prefix | A string that should be prepended to keys. |
|
protected string | $connection | The Redis connection instance that should be used to manage locks. |
|
protected string | $lockConnection | The name of the connection that should be used for locks. |
Methods
Begin executing a new tags operation.
Retrieve multiple items from the cache by key.
Store multiple items in the cache for a given number of seconds.
Create a new Redis store.
Retrieve an item from the cache by key.
Store an item in the cache for a given number of seconds.
Store an item in the cache if the key doesn't exist.
Increment the value of an item in the cache.
Decrement the value of an item in the cache.
Store an item in the cache indefinitely.
Restore a lock instance using the owner identifier.
Remove an item from the cache.
Remove all items from the cache.
Remove all expired tag set entries.
Get a collection of all of the cache tags currently being used.
Get the Redis connection instance.
Get the Redis connection instance that should be used to manage locks.
Specify the name of the connection that should be used to store data.
Specify the name of the connection that should be used to manage locks.
Get the cache key prefix.
Set the cache key prefix.
Prepare a value to be used with the Redis cache store when used by eval scripts.
Serialize the value.
Determine if the given value should be stored as plain value.
Unserialize the value.
Handle connection specific considerations when a value needs to be serialized.
Handle connection specific considerations when a value needs to be unserialized.
Details
array
many(array $keys)
Retrieve multiple items from the cache by key.
Items not found in the cache will have a null value.
bool
putMany(array $values, int $seconds)
Store multiple items in the cache for a given number of seconds.
__construct(Factory $redis, string $prefix = '', string $connection = 'default')
Create a new Redis store.
bool
put(string $key, mixed $value, int $seconds)
Store an item in the cache for a given number of seconds.
bool
add(string $key, mixed $value, int $seconds)
Store an item in the cache if the key doesn't exist.
protected LazyCollection
currentTags(int $chunkSize = 1000)
Get a collection of all of the cache tags currently being used.
void
setConnection(string $connection)
Specify the name of the connection that should be used to store data.
$this
setLockConnection(string $connection)
Specify the name of the connection that should be used to manage locks.
protected mixed
pack(mixed $value, Connection $connection)
Prepare a value to be used with the Redis cache store when used by eval scripts.
protected bool
shouldBeStoredWithoutSerialization(mixed $value)
Determine if the given value should be stored as plain value.
protected mixed
connectionAwareSerialize(mixed $value, Connection $connection)
Handle connection specific considerations when a value needs to be serialized.
protected mixed
connectionAwareUnserialize(mixed $value, Connection $connection)
Handle connection specific considerations when a value needs to be unserialized.