PHP Class CI_Cache, TastyIgniter

Author: EllisLab Dev Team
Inheritance: extends CI_Driver_Library
Afficher le fichier Open project: tastyigniter/tastyigniter Class Usage Examples

Méthodes publiques

Свойство Type Description
$key_prefix string Cache key prefix

Protected Properties

Свойство Type Description
$_adapter mixed Reference to the driver
$_backup_driver string Fallback driver
$_cache_path string Path of cache files (if file-based cache)
$valid_drivers array Valid cache drivers

Méthodes publiques

Méthode Description
__construct ( array $config = [] ) : void Constructor
cache_info ( string $type = 'user' ) : mixed Cache Info
clean ( ) : boolean Clean the cache
decrement ( string $id, integer $offset = 1 ) : mixed Decrement a raw value
delete ( string $id ) : boolean Delete from Cache
get ( string $id ) : mixed Get
get_metadata ( string $id ) : mixed Get Cache Metadata
increment ( string $id, integer $offset = 1 ) : mixed Increment a raw value
is_supported ( string $driver ) : array Is the requested driver supported in this environment?
save ( string $id, mixed $data, integer $ttl = 60, boolean $raw = FALSE ) : boolean Cache Save

Method Details

__construct() public méthode

Initialize class properties based on the configuration array.
public __construct ( array $config = [] ) : void
$config array = array()
Résultat void

cache_info() public méthode

Cache Info
public cache_info ( string $type = 'user' ) : mixed
$type string = 'user' user/filehits
Résultat mixed array containing cache info on success OR FALSE on failure

clean() public méthode

Clean the cache
public clean ( ) : boolean
Résultat boolean TRUE on success, FALSE on failure

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 $id ) : boolean
$id string Cache ID
Résultat boolean TRUE on success, FALSE on failure

get() public méthode

Look for a value in the cache. If it exists, return the data if not, return FALSE
public get ( string $id ) : mixed
$id string
Résultat mixed value matching $id or FALSE on failure

get_metadata() public méthode

Get Cache Metadata
public get_metadata ( string $id ) : mixed
$id string key to get cache metadata on
Résultat mixed cache item metadata

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

Is the requested driver supported in this environment?
public is_supported ( string $driver ) : array
$driver string The driver to test
Résultat array

save() public méthode

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

Property Details

$_adapter protected_oe property

Reference to the driver
protected mixed $_adapter
Résultat mixed

$_backup_driver protected_oe property

Fallback driver
protected string $_backup_driver
Résultat string

$_cache_path protected_oe property

Path of cache files (if file-based cache)
protected string $_cache_path
Résultat string

$key_prefix public_oe property

Cache key prefix
public string $key_prefix
Résultat string

$valid_drivers protected_oe property

Valid cache drivers
protected array $valid_drivers
Résultat array