\Charcoal\App\ConfigCacheConfig

Cache Configuration

Summary

Methods
Properties
Constants
defaults()
setTypes()
validTypes()
addType()
types()
setDefaultTtl()
defaultTtl()
setPrefix()
prefix()
setMiddleware()
middleware()
$middleware
No constants found
No protected methods found
No protected properties found
N/A
middlewareDefaults()
$types
$defaultTtl
$prefix
N/A

Properties

$middleware

$middleware : array

Type

array

$types

$types : array

Type

array

$defaultTtl

$defaultTtl : integer

The default TTL, in seconds.

10 days by default.

Type

integer

$prefix

$prefix : string

Type

string

Methods

defaults()

defaults() : array

Returns

array

setTypes()

setTypes(array<mixed,string>  $types) : \Charcoal\App\Config\CacheConfig

Set the types (drivers) of cache.

The first cache actually available on the system will be the one used for caching.

Parameters

array<mixed,string> $types

The types of cache to try using, in order of priority.

Returns

\Charcoal\App\Config\CacheConfig

Chainable

validTypes()

validTypes() : array

Get the valid types (drivers).

Returns

array

addType()

addType(string  $type) : \Charcoal\App\Config\CacheConfig

Parameters

string $type

The cache type.

Throws

\InvalidArgumentException

If the type is not a string.

Returns

\Charcoal\App\Config\CacheConfig

Chainable

types()

types() : array

Returns

array

setDefaultTtl()

setDefaultTtl(integer  $ttl) : \Charcoal\App\Config\CacheConfig

Parameters

integer $ttl

The time-to-live, in seconds.

Throws

\InvalidArgumentException

If the TTL argument is not numeric.

Returns

\Charcoal\App\Config\CacheConfig

Chainable

defaultTtl()

defaultTtl() : integer

Returns

integer

setPrefix()

setPrefix(string  $prefix) : \Charcoal\App\Config\CacheConfig

Parameters

string $prefix

The cache prefix (or namespace).

Throws

\InvalidArgumentException

If the prefix is not a string.

Returns

\Charcoal\App\Config\CacheConfig

Chainable

prefix()

prefix() : string

Returns

string

setMiddleware()

setMiddleware(array  $middleware) : \Charcoal\App\Config\CacheConfig

Parameters

array $middleware

The cache middleware configuration.

Returns

\Charcoal\App\Config\CacheConfig

Chainable

middleware()

middleware() : array

Returns

array

middlewareDefaults()

middlewareDefaults() : array

Returns

array