Cache class abstract
Framework\Cache\Cache
Class Cache.
Defined in libraries/cache/src/Cache.php
Properties #
- $configs
- Driver specific configurations.
- $prefix
- Keys prefix.
- $serializer
- Data serializer.
- $logger
- The Logger instance if is set.
- $defaultTtl
- The default Time To Live value.
- $debugCollector
- -
- $autoClose
- -
$configs
Driver specific configurations.
$prefix
Keys prefix.
$serializer
Data serializer.
$logger
The Logger instance if is set.
$defaultTtl
The default Time To Live value.
$debugCollector
$autoClose
Methods #
- __construct()
- Cache constructor.
- __destruct()
- -
- close()
- Close the cache storage.
- decrement()
- Decrements the value of one item.
- delete()
- Deletes one item from the cache storage.
- deleteMulti()
- Deletes multi items from the cache storage.
- flush()
- Flush the cache storage.
- get()
- Gets one item from the cache storage.
- getDefaultTtl()
- Get the default Time To Live value in seconds.
- getMulti()
- Gets multi items from the cache storage.
- getSerializer()
- -
- increment()
- Increments the value of one item.
- isAutoClose()
- -
- set()
- Sets one item to the cache storage.
- setAutoClose()
- -
- setDebugCollector()
- -
- setDefaultTtl()
- Set the default Time To Live value in seconds.
- setMulti()
- Sets multi items to the cache storage.
- addDebugDelete()
- -
- addDebugFlush()
- -
- addDebugGet()
- -
- addDebugSet()
- -
- initialize()
- Initialize Cache handlers and configurations.
- log()
- -
- makeTtl()
- Make the Time To Live value.
- renderKey()
- -
- serialize()
- -
- setConfigs()
- -
- setSerializer()
- -
- unserialize()
- -
__construct()
Cache constructor.
- mixed $configs - Driver specific configurations. Set null to not initialize and set a custom object.
- ?string $prefix - Keys prefix
- \Framework\Cache\Serializer|string $serializer - Data serializer
- ?\Framework\Log\Logger $logger - Logger instance
__destruct()
close()
Close the cache storage.
decrement()
Decrements the value of one item.
- string $key - The item name
- int $offset - The value to decrement
- ?int $ttl - The Time To Live for the item or null to use the default
delete()
Deletes one item from the cache storage.
- string $key - the item name
deleteMulti()
Deletes multi items from the cache storage.
- array $keys - List of items names to be deleted
flush()
Flush the cache storage.
get()
Gets one item from the cache storage.
- string $key - The item name
getDefaultTtl()
Get the default Time To Live value in seconds.
getMulti()
Gets multi items from the cache storage.
- array $keys - List of items names to get
getSerializer()
increment()
Increments the value of one item.
- string $key - The item name
- int $offset - The value to increment
- ?int $ttl - The Time To Live for the item or null to use the default
isAutoClose()
set()
Sets one item to the cache storage.
- string $key - The item name
- mixed $value - The item value
- ?int $ttl - The Time To Live for the item or null to use the default
setAutoClose()
- bool $autoClose - True to enable auto close, false to disable
setDebugCollector()
- \Framework\Cache\Debug\CacheCollector $debugCollector
setDefaultTtl()
Set the default Time To Live value in seconds.
- int $seconds - An integer greater than zero
setMulti()
Sets multi items to the cache storage.
- array $data - Associative array with key names and respective values
- ?int $ttl - The Time To Live for all the items or null to use the default
addDebugDelete()
- string $key
- float $start
- bool $status
addDebugFlush()
- float $start
- bool $status
addDebugGet()
- string $key
- float $start
- mixed $value
addDebugSet()
- string $key
- ?int $ttl
- float $start
- mixed $value
- bool $status
initialize()
Initialize Cache handlers and configurations.
log()
- string $message
- \Framework\Log\LogLevel $level
makeTtl()
Make the Time To Live value.
- ?int $seconds - TTL value or null to use the default
renderKey()
- string $key
serialize()
- mixed $value
setConfigs()
- array $configs
setSerializer()
- \Framework\Cache\Serializer|string $serializer
unserialize()
- string $value