\CI_Cache_redis

CodeIgniter Redis Caching Class

This class enables you to create drivers for a Library based on the Driver Library. It handles the drivers' access to the parent library

Summary

Methods
Properties
Constants
decorate()
__call()
__get()
__set()
get()
save()
delete()
clean()
cache_info()
get_metadata()
is_supported()
__destruct()
No public properties found
No constants found
_setup_redis()
$parent
$_default_config
$_redis
N/A
No private methods found
$methods
$properties
$reflections
N/A

Properties

$parent

$parent : 

Type

$_default_config

$_default_config : array

Default config

Type

array

$_redis

$_redis : \Redis

Redis connection

Type

\Redis

$methods

$methods : 

Type

$properties

$properties : 

Type

$reflections

$reflections : 

Type

Methods

decorate()

decorate(  $parent) : void

Decorate

Decorates the child with the parent driver lib's methods and properties

Parameters

$parent

__call()

__call(  $method,   $args = array()) : mixed

__call magic method

Handles access to the parent driver library's methods

Parameters

$method
$args

Returns

mixed

__get()

__get(  $var) : mixed

__get magic method

Handles reading of the parent driver library's properties

Parameters

$var

Returns

mixed

__set()

__set(  $var,   $val) : mixed

__set magic method

Handles writing to the parent driver library's properties

Parameters

$var
$val

Returns

mixed

get()

get(  $key) : mixed

Get cache

Parameters

$key

Returns

mixed

save()

save(  $key,   $value,   $ttl = NULL) : boolean

Save cache

Parameters

$key
$value
$ttl

Returns

boolean

delete()

delete(  $key) : boolean

Delete from cache

Parameters

$key

Returns

boolean

clean()

clean() : boolean

Clean cache

Returns

boolean

cache_info()

cache_info(  $type = NULL) : array

Get cache driver info

Parameters

$type

Returns

array

get_metadata()

get_metadata(  $key) : array

Get cache metadata

Parameters

$key

Returns

array

is_supported()

is_supported() : boolean

Check if Redis driver is supported

Returns

boolean

__destruct()

__destruct() : void

Class destructor

Closes the connection to Redis if present.

_setup_redis()

_setup_redis() : boolean

Setup Redis config and connection

Loads Redis config file if present. Will halt execution if a Redis connection can't be established.

Returns

boolean