CacheInterface

Extends

Interface implemented by cache classes.

It is highly recommended to always store templates on the filesystem to benefit from the PHP opcode cache. This interface is mostly useful if you need to implement a custom strategy for storing templates on the filesystem.

author

Andrew Tch andrew@noop.lv

package

Default

Methods

Generates a cache key for the given template class name.

generateKey(string $name,string $className): string

Arguments

$name

string

The template name

$className

string

The template class name

Response

string

Returns the modification timestamp of a key.

getTimestamp(string $key): integer

Arguments

$key

string

The cache key

Response

integer

Loads a template from the cache.

load(string $key)

Arguments

$key

string

The cache key

Writes the compiled template to cache.

write(string $key,string $content)

Arguments

$key

string

The cache key

$content

string

The template representation as a PHP class