PHP Class CI_Cache_redis, TastyIgniter

Author: Anton Lindqvist ([email protected])
Inheritance: extends CI_Driver
Afficher le fichier Open project: tastyigniter/tastyigniter

Protected Properties

Свойство Type Description
$_default_config array Default config
$_redis Redis Redis connection
$_serialized array An internal cache for storing keys of serialized values.

Méthodes publiques

Méthode Description
__construct ( ) : void Class constructor
__destruct ( ) : void Class destructor
cache_info ( string $type = NULL ) : array Get cache driver info
clean ( ) : boolean Clean cache
decrement ( string $id, integer $offset = 1 ) : mixed Decrement a raw value
delete ( string $key ) : boolean Delete from cache
get ( string $key ) : mixed Get cache
get_metadata ( string $key ) : array Get cache metadata
increment ( string $id, integer $offset = 1 ) : mixed Increment a raw value
is_supported ( ) : boolean Check if Redis driver is supported
save ( string $id, mixed $data, integer $ttl = 60, boolean $raw = FALSE ) : boolean Save cache

Method Details

__construct() public méthode

Setup Redis Loads Redis config file if present. Will halt execution if a Redis connection can't be established.
See also: Redis::connect()
public __construct ( ) : void
Résultat void

__destruct() public méthode

Closes the connection to Redis if present.
public __destruct ( ) : void
Résultat void

cache_info() public méthode

Get cache driver info
See also: Redis::info()
public cache_info ( string $type = NULL ) : array
$type string Not supported in Redis. Only included in order to offer a consistent cache API.
Résultat array

clean() public méthode

Clean cache
See also: Redis::flushDB()
public clean ( ) : boolean
Résultat boolean

decrement() public méthode

Decrement a raw value
public decrement ( string $id, integer $offset = 1 ) : mixed
$id string Cache ID
$offset integer Step/value to reduce by
Résultat mixed New value on success or FALSE on failure

delete() public méthode

Delete from cache
public delete ( string $key ) : boolean
$key string Cache key
Résultat boolean

get() public méthode

Get cache
public get ( string $key ) : mixed
$key string Cache ID
Résultat mixed

get_metadata() public méthode

Get cache metadata
public get_metadata ( string $key ) : array
$key string Cache key
Résultat array

increment() public méthode

Increment a raw value
public increment ( string $id, integer $offset = 1 ) : mixed
$id string Cache ID
$offset integer Step/value to add
Résultat mixed New value on success or FALSE on failure

is_supported() public méthode

Check if Redis driver is supported
public is_supported ( ) : boolean
Résultat boolean

save() public méthode

Save cache
public save ( string $id, mixed $data, integer $ttl = 60, boolean $raw = FALSE ) : boolean
$id string Cache ID
$data mixed Data to save
$ttl integer Time to live in seconds
$raw boolean Whether to store the raw value (unused)
Résultat boolean TRUE on success, FALSE on failure

Property Details

$_default_config protected_oe static_oe property

Default config
protected static array $_default_config
Résultat array

$_redis protected_oe property

Redis connection
protected Redis $_redis
Résultat Redis

$_serialized protected_oe property

An internal cache for storing keys of serialized values.
protected array $_serialized
Résultat array