Methods summary
public
|
#
__construct( array $options = array() )
Constructor
Parameters
Throws
Overrides
|
public
mixed
|
#
setDriver( string $driver )
Set cache driver
Parameters
Returns
mixed $this
Throws
|
public
string
|
#
getDriver( )
Returns current cache driver
Returns current cache driver
Returns
string
|
public
mixed
|
#
get( string $key, integer $expire = null, callable $fn = null )
Retrieve an item
Parameters
- $key
- The name of item
- $expire
- The expire seconds of callback return value
- $fn
- The callback to execute when cache not found
Returns
mixed
Throws
|
public
boolean
|
#
set( string $key, mixed $value, integer $expire = 0 )
Store an item
Parameters
- $key
- The name of item
- $value
- The value of item
- $expire
- The expire seconds, defaults to 0, means never expired
Returns
boolean
|
public
boolean
|
#
remove( string $key )
Remove an item
Parameters
Returns
boolean
|
public
boolean
|
#
exists( string $key )
Check if an item is exists
Check if an item is exists
Parameters
Returns
boolean
|
public
boolean
|
#
add( string $key, mixed $value, integer $expire = 0 )
Add an item
Parameters
- $key
- The name of item
- $value
- The value of item
- $expire
- The expire seconds, defaults to 0, means never expired
Returns
boolean
|
public
boolean
|
#
replace( string $key, mixed $value, integer $expire = 0 )
Replace an existing item
Parameters
- $key
- The name of item
- $value
- The value of item
- $expire
- The expire seconds, defaults to 0, means never expired
Returns
boolean
|
public
integer|false
|
#
incr( string $key, integer $offset = 1 )
Increment an item
Parameters
- $key
- The name of item
- $offset
- The value to increased
Returns
integer|false Returns the new value on success, or false on failure
|
public
boolean
|
#
clear( )
Clear all items
Returns
boolean
|