-
Notifications
You must be signed in to change notification settings - Fork 0
CI_Cache
CodeIgniter Caching Class
This class enables you to create "Driver" libraries that add runtime ability to extend the capabilities of a class via additional driver objects
- Class name: CI_Cache
- Namespace:
- Parent class: CI_Driver_Library
protected array $valid_drivers = array()
Array of drivers that are available to use with the driver class
- Visibility: protected
protected string $_cache_path = NULL
Path of cache files (if file-based cache)
- Visibility: protected
protected mixed $_adapter = 'dummy'
Reference to the driver
- Visibility: protected
protected string $_backup_driver = 'dummy'
Fallback driver
- Visibility: protected
public string $key_prefix = ''
Cache key prefix
- Visibility: public
protected string $lib_name
Name of the current class - usually the driver class
- Visibility: protected
void CI_Cache::__construct(array $config)
Constructor
Initialize class properties based on the configuration array.
- Visibility: public
- $config array - <p>= array()</p>
mixed CI_Cache::get(string $id)
Get
Look for a value in the cache. If it exists, return the data if not, return FALSE
- Visibility: public
- $id string
boolean CI_Cache::save(string $id, mixed $data, integer $ttl, boolean $raw)
Cache Save
- Visibility: public
- $id string - <p>Cache ID</p>
- $data mixed - <p>Data to store</p>
- $ttl integer - <p>Cache TTL (in seconds)</p>
- $raw boolean - <p>Whether to store the raw value</p>
boolean CI_Cache::delete(string $id)
Delete from Cache
- Visibility: public
- $id string - <p>Cache ID</p>
mixed CI_Cache::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::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::clean()
Clean the cache
- Visibility: public
mixed CI_Cache::cache_info(string $type)
Cache Info
- Visibility: public
- $type string - <p>= 'user' user/filehits</p>
mixed CI_Cache::get_metadata(string $id)
Get Cache Metadata
- Visibility: public
- $id string - <p>key to get cache metadata on</p>
array CI_Cache::is_supported(string $driver)
Is the requested driver supported in this environment?
- Visibility: public
- $driver string - <p>The driver to test</p>
object CI_Driver_Library::__get($child)
Get magic method
The first time a child is used it won't exist, so we instantiate it subsequents calls will go straight to the proper child.
- Visibility: public
- This method is defined by CI_Driver_Library
- $child mixed
object CI_Driver_Library::load_driver($child)
Load driver
Separate load_driver call to support explicit driver load by library or user
- Visibility: public
- This method is defined by CI_Driver_Library
- $child mixed