-
Notifications
You must be signed in to change notification settings - Fork 0
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
- Class name: CI_Cache_redis
- Namespace:
- Parent class: CI_Driver
protected array $_default_config = array('socket_type' => 'tcp', 'host' => '127.0.0.1', 'password' => NULL, 'port' => 6379, 'timeout' => 0)
Default config
- Visibility: protected
- This property is static.
protected \Redis $_redis
Redis connection
- Visibility: protected
protected array $_serialized = array()
An internal cache for storing keys of serialized values.
- Visibility: protected
protected object $_parent
Instance of the parent class
- Visibility: protected
protected array $_methods = array()
List of methods in the parent class
- Visibility: protected
protected array $_properties = array()
List of properties in the parent class
- Visibility: protected
protected array $_reflections = array()
Array of methods and properties for the parent class(es)
- Visibility: protected
- This property is static.
void CI_Cache_redis::__construct()
Class constructor
Setup Redis
Loads Redis config file if present. Will halt execution if a Redis connection can't be established.
- Visibility: public
mixed CI_Cache_redis::get($key)
Get cache
- Visibility: public
- $key mixed
boolean CI_Cache_redis::save(string $id, mixed $data, integer $ttl, boolean $raw)
Save cache
- Visibility: public
- $id string - <p>Cache ID</p>
- $data mixed - <p>Data to save</p>
- $ttl integer - <p>Time to live in seconds</p>
- $raw boolean - <p>Whether to store the raw value (unused)</p>
boolean CI_Cache_redis::delete($key)
Delete from cache
- Visibility: public
- $key mixed
mixed CI_Cache_redis::increment(string $id, integer $offset)
Increment a raw value
- Visibility: public
- $id string - <p>Cache ID</p>
- $offset integer - <p>Step/value to add</p>
mixed CI_Cache_redis::decrement(string $id, integer $offset)
Decrement a raw value
- Visibility: public
- $id string - <p>Cache ID</p>
- $offset integer - <p>Step/value to reduce by</p>
boolean CI_Cache_redis::clean()
Clean cache
- Visibility: public
array CI_Cache_redis::cache_info($type)
Get cache driver info
- Visibility: public
- $type mixed
array CI_Cache_redis::get_metadata($key)
Get cache metadata
- Visibility: public
- $key mixed
boolean CI_Cache_redis::is_supported()
Check if Redis driver is supported
- Visibility: public
void CI_Cache_redis::__destruct()
Class destructor
Closes the connection to Redis if present.
- Visibility: public
void CI_Driver::decorate($parent)
Decorate
Decorates the child with the parent driver lib's methods and properties
- Visibility: public
- This method is defined by CI_Driver
- $parent mixed
mixed CI_Driver::__call($method, $args)
__call magic method
Handles access to the parent driver library's methods
- Visibility: public
- This method is defined by CI_Driver
- $method mixed
- $args mixed
mixed CI_Driver::__get($var)
__get magic method
Handles reading of the parent driver library's properties
- Visibility: public
- This method is defined by CI_Driver
- $var mixed
mixed CI_Driver::__set($var, $val)
__set magic method
Handles writing to the parent driver library's properties
- Visibility: public
- This method is defined by CI_Driver
- $var mixed
- $val mixed