DiscordPHP Documentation

CacheConfig
in package

Cache configuration class. To be used with Discord `cache` Options.

Tags
see
Discord
see
CacheWrapper
since
10.0.0

Table of Contents

$compress  : bool
Whether to compress cache data before serialization, disabled by default, ignored in ArrayCache.
$interface  : CacheInterface|CacheInterface
$separator  : string
$sweep  : bool
Whether to automatically sweep cached items from memory, disabled by default.
$ttl  : null|int|DateInterval|float
The default Time To Live for `$interface::set()` and `$interface::setMultiple()`.
$interface  : CacheInterface|CacheInterface
$separator  : string
__construct()  : mixed
__get()  : mixed

Properties

$compress

Whether to compress cache data before serialization, disabled by default, ignored in ArrayCache.

public bool $compress = false

$interface read-only

public CacheInterface|CacheInterface $interface

The PSR-16 cache interface.

$separator read-only

public string $separator

The cache key prefix separator if supported by the interface. Usually dot . for generic cache or colon : for Redis/Memcached.

$sweep

Whether to automatically sweep cached items from memory, disabled by default.

public bool $sweep = false

$ttl

The default Time To Live for `$interface::set()` and `$interface::setMultiple()`.

public null|int|DateInterval|float $ttl

$interface

protected CacheInterface|CacheInterface $interface

Methods

__construct()

public __construct(CacheInterface|CacheInterface $interface[, bool $compress = false ][, bool $sweep = false ][, string|null $separator = null ][, null|int|DateInterval|float $ttl = null ]) : mixed
Parameters
$interface : CacheInterface|CacheInterface

The PSR-16 Cache Interface.

$compress : bool = false

Whether to compress cache data before serialization, ignored in ArrayCache.

$sweep : bool = false

Whether to automatically sweep cache.

$separator : string|null = null

The cache key prefix separator, null for default.

$ttl : null|int|DateInterval|float = null

The cache time to live default value to pass to the interface.

Return values
mixed

__get()

public __get(string $name) : mixed
Parameters
$name : string
Return values
mixed

Search results