\OCPIMemcacheTTL

Interface for memcache backends that support setting ttl after the value is set

Summary

Methods
Constants
add()
inc()
dec()
cas()
cad()
get()
set()
hasKey()
remove()
clear()
setTTL()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

add()

add(string  $key, mixed  $value, integer  $ttl) : boolean

Set a value in the cache if it's not already stored

Parameters

string $key
mixed $value
integer $ttl

Time To Live in seconds. Defaults to 606024

Returns

boolean

inc()

inc(string  $key, integer  $step = 1) : integer

Increase a stored number

Parameters

string $key
integer $step

Returns

integer —

| bool

dec()

dec(string  $key, integer  $step = 1) : integer

Decrease a stored number

Parameters

string $key
integer $step

Returns

integer —

| bool

cas()

cas(string  $key, mixed  $old, mixed  $new) : boolean

Compare and set

Parameters

string $key
mixed $old
mixed $new

Returns

boolean

cad()

cad(string  $key, mixed  $old) : boolean

Compare and delete

Parameters

string $key
mixed $old

Returns

boolean

get()

get(string  $key) : mixed

Get a value from the user cache

Parameters

string $key

Returns

mixed

set()

set(string  $key, mixed  $value, integer  $ttl) : boolean

Set a value in the user cache

Parameters

string $key
mixed $value
integer $ttl

Time To Live in seconds. Defaults to 606024

Returns

boolean

hasKey()

hasKey(string  $key) : boolean

Check if a value is set in the user cache

Parameters

string $key

Returns

boolean

remove()

remove(string  $key) : boolean

Remove an item from the user cache

Parameters

string $key

Returns

boolean

clear()

clear(string  $prefix = '') : boolean

Clear the user cache of all entries starting with a prefix

Parameters

string $prefix

(optional)

Returns

boolean

setTTL()

setTTL(string  $key, integer  $ttl) 

Set the ttl for an existing value

Parameters

string $key
integer $ttl

time to live in seconds