Cache
in package
View stream template compiled-cache class
Tags
Table of Contents
Properties
- $dir : string
- Cache directory
Methods
- __construct() : mixed
- Constructor
- get() : string|null
- Get cached compiled source for a key, or null on miss/stale
- getDir() : string
- Get the cache directory
- key() : string
- Derive a stable cache key from resolved template content
- path() : string
- Get the absolute path to the cache file for a given key
- put() : void
- Write compiled source to the cache, atomically
Properties
$dir
Cache directory
protected
string
$dir
Methods
__construct()
Constructor
public
__construct(string $dir) : mixed
Parameters
- $dir : string
get()
Get cached compiled source for a key, or null on miss/stale
public
get(string $key, int $newestSourceMtime) : string|null
Parameters
- $key : string
- $newestSourceMtime : int
Return values
string|nullgetDir()
Get the cache directory
public
getDir() : string
Return values
stringkey()
Derive a stable cache key from resolved template content
public
static key(string $resolvedTemplate) : string
Parameters
- $resolvedTemplate : string
Return values
stringpath()
Get the absolute path to the cache file for a given key
public
path(string $key) : string
Parameters
- $key : string
Return values
stringput()
Write compiled source to the cache, atomically
public
put(string $key, string $source) : void
Parameters
- $key : string
- $source : string