Documentation

LocalCache
in package

Table of Contents

Properties

$db  : mixed

Methods

get()  : string|null
Get an item from the cache.
put()  : mixed
Put an item in the cache.
putTTL()  : mixed
Put an item in the cache with a TTL.
initDB()  : mixed

Properties

Methods

get()

Get an item from the cache.

public static get(string $key) : string|null
Parameters
$key : string

Key of the cached item to retrieve.

Return values
string|null

Cache item, or null if there is none.

put()

Put an item in the cache.

public static put(string $key, string $value, DateTime $valid_until) : mixed
Parameters
$key : string

Key of the cached item.

$value : string

Value to cache.

$valid_until : DateTime

Expiration.

putTTL()

Put an item in the cache with a TTL.

public static putTTL(string $key, string $value, int $seconds) : mixed
Parameters
$key : string
$value : string
$seconds : int

        
On this page

Search results