class Illuminate / Cache / RedisStore

RedisStore

Extends

Implements

Properties

protected

$redis Factory

The Redis factory implementation.

Default: null
protected

$prefix string

A string that should be prepended to keys.

Default: null
protected

$connection string

The Redis connection instance that should be used to manage locks.

Default: null
protected

$lockConnection string

The name of the connection that should be used for locks.

Default: null

Methods

public

__construct ( Factory $redis , $prefix , $connection ) : void

Create a new Redis store.

Parameters

  • $redis Factory
  • $prefix string
  • $connection string
public

get ( $key ) : mixed

Retrieve an item from the cache by key.

Parameters

  • $key string|array
public

many ( array $keys ) : array

Retrieve multiple items from the cache by key.

Parameters

  • $keys array
public

put ( $key , $value , $seconds ) : bool

Store an item in the cache for a given number of seconds.

Parameters

  • $key string
  • $value mixed
  • $seconds int
public

putMany ( array $values , $seconds ) : bool

Store multiple items in the cache for a given number of seconds.

Parameters

  • $values array
  • $seconds int
public

add ( $key , $value , $seconds ) : bool

Store an item in the cache if the key doesn't exist.

Parameters

  • $key string
  • $value mixed
  • $seconds int
public

increment ( $key , $value ) : int

Increment the value of an item in the cache.

Parameters

  • $key string
  • $value mixed
public

decrement ( $key , $value ) : int

Decrement the value of an item in the cache.

Parameters

  • $key string
  • $value mixed
public

forever ( $key , $value ) : bool

Store an item in the cache indefinitely.

Parameters

  • $key string
  • $value mixed
public

lock ( $name , $seconds , $owner ) : Lock

Get a lock instance.

Parameters

  • $name string
  • $seconds int
  • $owner string|null
public

restoreLock ( $name , $owner ) : Lock

Restore a lock instance using the owner identifier.

Parameters

  • $name string
  • $owner string
public

forget ( $key ) : bool

Remove an item from the cache.

Parameters

  • $key string
public

flush ( ) : bool

Remove all items from the cache.

public

flushStaleTags ( ) : void

Remove all expired tag set entries.

public

tags ( $names ) : RedisTaggedCache

Begin executing a new tags operation.

Parameters

  • $names array|mixed
protected

currentTags ( $chunkSize ) : Illuminate\...\LazyCollection

Get a collection of all of the cache tags currently being used.

Parameters

  • $chunkSize int
public

connection ( ) : Connection

Get the Redis connection instance.

public

lockConnection ( ) : Connection

Get the Redis connection instance that should be used to manage locks.

public

setConnection ( $connection ) : void

Specify the name of the connection that should be used to store data.

Parameters

  • $connection string
public

setLockConnection ( $connection ) : $this

Specify the name of the connection that should be used to manage locks.

Parameters

  • $connection string
public

getRedis ( ) : Factory

Get the Redis database instance.

public

getPrefix ( ) : string

Get the cache key prefix.

public

setPrefix ( $prefix ) : void

Set the cache key prefix.

Parameters

  • $prefix string
protected

serialize ( $value ) : mixed

Serialize the value.

Parameters

  • $value mixed
protected

unserialize ( $value ) : mixed

Unserialize the value.

Parameters

  • $value mixed