IMemcacheTTL
extends
IMemcache
in
Interface for memcache backends that support setting ttl after the value is set
Tags
Table of Contents
Methods
- add() : bool
- Set a value in the cache if it's not already stored
- cad() : bool
- Compare and delete
- cas() : bool
- Compare and set
- clear() : bool
- Clear the user cache of all entries starting with a prefix
- dec() : int
- Decrease a stored number
- get() : mixed
- Get a value from the user cache
- hasKey() : bool
- Check if a value is set in the user cache
- inc() : int
- Increase a stored number
- isAvailable() : bool
- Check if the cache implementation is available
- remove() : bool
- Remove an item from the user cache
- set() : bool
- Set a value in the user cache
- setTTL() : mixed
- Set the ttl for an existing value
Methods
add()
Set a value in the cache if it's not already stored
public
add(string $key, mixed $value[, int $ttl = 0 ]) : bool
Parameters
- $key : string
- $value : mixed
- $ttl : int = 0
-
Time To Live in seconds. Defaults to 606024
Tags
Return values
boolcad()
Compare and delete
public
cad(string $key, mixed $old) : bool
Parameters
- $key : string
- $old : mixed
Tags
Return values
boolcas()
Compare and set
public
cas(string $key, mixed $old, mixed $new) : bool
Parameters
- $key : string
- $old : mixed
- $new : mixed
Tags
Return values
boolclear()
Clear the user cache of all entries starting with a prefix
public
clear([string $prefix = '' ]) : bool
Parameters
- $prefix : string = ''
-
(optional)
Tags
Return values
booldec()
Decrease a stored number
public
dec(string $key[, int $step = 1 ]) : int
Parameters
- $key : string
- $step : int = 1
Tags
Return values
int —| bool
get()
Get a value from the user cache
public
get(string $key) : mixed
Parameters
- $key : string
Tags
hasKey()
Check if a value is set in the user cache
public
hasKey(string $key) : bool
Parameters
- $key : string
Tags
Return values
boolinc()
Increase a stored number
public
inc(string $key[, int $step = 1 ]) : int
Parameters
- $key : string
- $step : int = 1
Tags
Return values
int —| bool
isAvailable()
Check if the cache implementation is available
public
static isAvailable() : bool
Tags
Return values
boolremove()
Remove an item from the user cache
public
remove(string $key) : bool
Parameters
- $key : string
Tags
Return values
boolset()
Set a value in the user cache
public
set(string $key, mixed $value[, int $ttl = 0 ]) : bool
Parameters
- $key : string
- $value : mixed
- $ttl : int = 0
-
Time To Live in seconds. Defaults to 606024
Tags
Return values
boolsetTTL()
Set the ttl for an existing value
public
setTTL(string $key, int $ttl) : mixed
Parameters
- $key : string
- $ttl : int
-
time to live in seconds