final class Cache

internal  
 

Caching of compiled templates.

Properties

$directory
$autoRefresh

Methods

void
loadOrCreate(Engine $engine, string $name)

Loads existing cache or compiles template if needed.

string
generateFilePath(Engine $engine, string $name)

Returns the file path where compiled template will be cached.

static bool
isCacheFile(string $file)

No description

array
generateRefreshSignature(Engine $engine, string $name)

Returns values used to detect if cached template needs recompilation when autoRefresh is enabled.

Details

at line 30
void loadOrCreate(Engine $engine, string $name)

Loads existing cache or compiles template if needed.

Uses file locking to ensure atomic operations and prevent race conditions.

Parameters

Engine $engine
string $name

Return Value

void

at line 109
string generateFilePath(Engine $engine, string $name)

Returns the file path where compiled template will be cached.

Different configurations produce different file paths.

Parameters

Engine $engine
string $name

Return Value

string

at line 121
static bool isCacheFile(string $file)

No description

Parameters

string $file

Return Value

bool

at line 131
protected array generateRefreshSignature(Engine $engine, string $name)

Returns values used to detect if cached template needs recompilation when autoRefresh is enabled.

Triggers recompilation when template code, Latte engine, or any extension changes.

Parameters

Engine $engine
string $name

Return Value

array