PHP Класс Bluz\Cache\Cache

Configuration 'enabled' => true, // Boolean,optional, true by default 'cacheAdapter' => 'redis', // Required if option 'enabled' set to true 'tagAdapter' => 'memcached', // Optional 'settings' => [ 'redis' => [], // Settings for setup Instance of Bluz\Cache\CacheInterface. 'memcached' => [], // Settings for another cache adapter ]
Автор: murzik
Наследование: implements Bluz\Cache\CacheInterface, implements Bluz\Cache\TagableInterface, use trait Bluz\Common\Options
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$adapter Instance of cache adapter
$prefix Prefix for cache keys
$tagAdapter Instance of tag adapter
$tagPrefix Prefix for tags

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

Метод Описание
add ( string $id, mixed $data, integer $ttl = Cache::TTL_NO_EXPIRY ) : boolean
addTag ( string $id, string $tag ) : boolean
contains ( string $id ) : boolean
delete ( string $id ) : mixed
deleteByTag ( string $tag ) : boolean
flush ( ) : void
get ( string $id ) : mixed
getAdapter ( string $adapterName = null ) : Bluz\Cache\CacheInterface Get underlying cache adapter
getTagAdapter ( ) : Bluz\Cache\CacheInterface Get underlying tag adapter
set ( string $id, mixed $data, integer $ttl = Cache::TTL_NO_EXPIRY ) : boolean
setPrefix ( string $prefix ) : void Setup prefix for cache records
setTagPrefix ( string $prefix ) : void Setup prefix for cache records of tags

Защищенные методы

Метод Описание
initAdapter ( string $adapterName ) : Bluz\Cache\CacheInterface Initialize adapter
initOptions ( ) : void Check Cache configuration
prepareId ( string $id ) : string Prepare Id with prefix

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

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

public add ( string $id, mixed $data, integer $ttl = Cache::TTL_NO_EXPIRY ) : boolean
$id string
$data mixed
$ttl integer
Результат boolean

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

public addTag ( string $id, string $tag ) : boolean
$id string
$tag string
Результат boolean

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

public contains ( string $id ) : boolean
$id string
Результат boolean

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

public delete ( string $id ) : mixed
$id string
Результат mixed

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

public deleteByTag ( string $tag ) : boolean
$tag string
Результат boolean

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

public flush ( ) : void
Результат void

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

public get ( string $id ) : mixed
$id string
Результат mixed

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

Get underlying cache adapter
public getAdapter ( string $adapterName = null ) : Bluz\Cache\CacheInterface
$adapterName string
Результат Bluz\Cache\CacheInterface

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

Get underlying tag adapter
public getTagAdapter ( ) : Bluz\Cache\CacheInterface
Результат Bluz\Cache\CacheInterface

initAdapter() защищенный Метод

Initialize adapter
protected initAdapter ( string $adapterName ) : Bluz\Cache\CacheInterface
$adapterName string
Результат Bluz\Cache\CacheInterface

initOptions() защищенный Метод

Check Cache configuration
protected initOptions ( ) : void
Результат void

prepareId() защищенный Метод

Prepare Id with prefix
protected prepareId ( string $id ) : string
$id string
Результат string

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

public set ( string $id, mixed $data, integer $ttl = Cache::TTL_NO_EXPIRY ) : boolean
$id string
$data mixed
$ttl integer
Результат boolean

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

Setup prefix for cache records
public setPrefix ( string $prefix ) : void
$prefix string
Результат void

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

Setup prefix for cache records of tags
public setTagPrefix ( string $prefix ) : void
$prefix string
Результат void

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

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

Instance of cache adapter
protected $adapter

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

Prefix for cache keys
protected $prefix

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

Instance of tag adapter
protected $tagAdapter

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

Prefix for tags
protected $tagPrefix