PHP Класс CI_Cache, TastyIgniter

Автор: EllisLab Dev Team
Наследование: extends CI_Driver_Library
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$key_prefix string Cache key prefix

Защищенные свойства (Protected)

Свойство Тип Описание
$_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

Открытые методы

Метод Описание
__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

Описание методов

__construct() публичный Метод

Initialize class properties based on the configuration array.
public __construct ( array $config = [] ) : void
$config array = array()
Результат void

cache_info() публичный Метод

Cache Info
public cache_info ( string $type = 'user' ) : mixed
$type string = 'user' user/filehits
Результат mixed array containing cache info on success OR FALSE on failure

clean() публичный Метод

Clean the cache
public clean ( ) : boolean
Результат boolean TRUE on success, FALSE on failure

decrement() публичный Метод

Decrement a raw value
public decrement ( string $id, integer $offset = 1 ) : mixed
$id string Cache ID
$offset integer Step/value to reduce by
Результат mixed New value on success or FALSE on failure

delete() публичный Метод

Delete from Cache
public delete ( string $id ) : boolean
$id string Cache ID
Результат boolean TRUE on success, FALSE on failure

get() публичный Метод

Look for a value in the cache. If it exists, return the data if not, return FALSE
public get ( string $id ) : mixed
$id string
Результат mixed value matching $id or FALSE on failure

get_metadata() публичный Метод

Get Cache Metadata
public get_metadata ( string $id ) : mixed
$id string key to get cache metadata on
Результат mixed cache item metadata

increment() публичный Метод

Increment a raw value
public increment ( string $id, integer $offset = 1 ) : mixed
$id string Cache ID
$offset integer Step/value to add
Результат mixed New value on success or FALSE on failure

is_supported() публичный Метод

Is the requested driver supported in this environment?
public is_supported ( string $driver ) : array
$driver string The driver to test
Результат array

save() публичный Метод

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
Результат boolean TRUE on success, FALSE on failure

Описание свойств

$_adapter защищенное свойство

Reference to the driver
protected mixed $_adapter
Результат mixed

$_backup_driver защищенное свойство

Fallback driver
protected string $_backup_driver
Результат string

$_cache_path защищенное свойство

Path of cache files (if file-based cache)
protected string $_cache_path
Результат string

$key_prefix публичное свойство

Cache key prefix
public string $key_prefix
Результат string

$valid_drivers защищенное свойство

Valid cache drivers
protected array $valid_drivers
Результат array