PHP Класс Microweber\Providers\CacheManager

These functions will allow you to save and get data from the MW cache system
Показать файл Открыть проект

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

Свойство Тип Описание
$adapter An instance of the cache adapter to use.
$app An instance of the Microweber Application class.

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

Метод Описание
__construct ( $app = null )
clear ( ) : boolean Clears all cache data.
debug ( ) : array Prints cache debug information.
delete ( string $cache_group = 'global' ) : boolean Deletes cache for given $cache_group recursively.
get ( string $cache_id, string $cache_group = 'global', boolean $timeout = false ) : mixed Gets the data from the cache.
save ( mixed $data_to_cache, string $cache_id, string $cache_group = 'global', $expiration = false ) : boolean Stores your data in the cache.

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

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

public __construct ( $app = null )

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

Clears all cache data.
public clear ( ) : boolean
Результат boolean

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

Prints cache debug information.
public debug ( ) : array
Результат array

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

Deletes cache for given $cache_group recursively.
public delete ( string $cache_group = 'global' ) : boolean
$cache_group string (default is 'global') - this is the subfolder in the cache dir.
Результат boolean

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

If data is not found it return false *
public get ( string $cache_id, string $cache_group = 'global', boolean $timeout = false ) : mixed
$cache_id string id of the cache
$cache_group string (default is 'global') - this is the subfolder in the cache dir.
$timeout boolean
Результат mixed returns array of cached data or false

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

It can store any value that can be serialized, such as strings, array, etc.
public save ( mixed $data_to_cache, string $cache_id, string $cache_group = 'global', $expiration = false ) : boolean
$data_to_cache mixed your data, anything that can be serialized
$cache_id string id of the cache, you must define it because you will use it later to retrieve the cached content.
$cache_group string (default is 'global') - this is the subfolder in the cache dir.
Результат boolean

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

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

An instance of the cache adapter to use.
public $adapter

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

An instance of the Microweber Application class.
public $app