MemcachedStore
Extends
Implements
Uses
Properties
$prefix string
A string that should be prepended to keys.
$onVersionThree bool
Indicates whether we are using Memcached version >= 3.0.0.
Methods
__construct ( $memcached , $prefix ) : void
Create a new Memcached store.
Parameters
- $memcached Memcached
- $prefix string
get ( $key ) : mixed
Retrieve an item from the cache by key.
Parameters
- $key string
many ( array $keys ) : array
Retrieve multiple items from the cache by key.
Parameters
- $keys array
put ( $key , $value , $seconds ) : bool
Store an item in the cache for a given number of seconds.
Parameters
- $key string
- $value mixed
- $seconds int
putMany ( array $values , $seconds ) : bool
Store multiple items in the cache for a given number of seconds.
Parameters
- $values array
- $seconds int
add ( $key , $value , $seconds ) : bool
Store an item in the cache if the key doesn't exist.
Parameters
- $key string
- $value mixed
- $seconds int
increment ( $key , $value ) : int|bool
Increment the value of an item in the cache.
Parameters
- $key string
- $value mixed
decrement ( $key , $value ) : int|bool
Decrement the value of an item in the cache.
Parameters
- $key string
- $value mixed
forever ( $key , $value ) : bool
Store an item in the cache indefinitely.
Parameters
- $key string
- $value mixed
lock ( $name , $seconds , $owner ) : Lock
Get a lock instance.
Parameters
- $name string
- $seconds int
- $owner string|null
restoreLock ( $name , $owner ) : Lock
Restore a lock instance using the owner identifier.
Parameters
- $name string
- $owner string
forget ( $key ) : bool
Remove an item from the cache.
Parameters
- $key string
flush ( ) : bool
Remove all items from the cache.
calculateExpiration ( $seconds ) : int
Get the expiration time of the key.
Parameters
- $seconds int
toTimestamp ( $seconds ) : int
Get the UNIX timestamp for the given number of seconds.
Parameters
- $seconds int
getPrefix ( ) : string
Get the cache key prefix.
setPrefix ( $prefix ) : void
Set the cache key prefix.
Parameters
- $prefix string