IMemcacheTTL extends IMemcache
Interface for memcache backends that support setting ttl after the value is set
Tags
Table of Contents
- 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
- 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) : bool
Parameters
- $key : string
- $value : mixed
- $ttl : int
-
Time To Live in seconds. Defaults to 606024
Tags
Return values
bool —cad()
Compare and delete
public
cad(string $key, mixed $old) : bool
Parameters
- $key : string
- $old : mixed
Tags
Return values
bool —cas()
Compare and set
public
cas(string $key, mixed $old, mixed $new) : bool
Parameters
- $key : string
- $old : mixed
- $new : mixed
Tags
Return values
bool —clear()
Clear the user cache of all entries starting with a prefix
public
clear([string $prefix = '' ]) : bool
Parameters
- $prefix : string = ''
-
(optional)
Tags
Return values
bool —dec()
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
Return values
mixed —hasKey()
Check if a value is set in the user cache
public
hasKey(string $key) : bool
Parameters
- $key : string
Tags
Return values
bool —inc()
Increase a stored number
public
inc(string $key[, int $step = 1 ]) : int
Parameters
- $key : string
- $step : int = 1
Tags
Return values
int —| bool
remove()
Remove an item from the user cache
public
remove(string $key) : bool
Parameters
- $key : string
Tags
Return values
bool —set()
Set a value in the user cache
public
set(string $key, mixed $value, int $ttl) : bool
Parameters
- $key : string
- $value : mixed
- $ttl : int
-
Time To Live in seconds. Defaults to 606024
Tags
Return values
bool —setTTL()
Set the ttl for an existing value
public
setTTL(string $key, int $ttl) : mixed
Parameters
- $key : string
- $ttl : int
-
time to live in seconds