Documentation

Cache
in package

View stream template compiled-cache class

Tags
category

Pop

author

Nick Sagona, III nick@popphp.org

copyright

Copyright (c) 2009-2026 Nick Sagona, III

license

https://www.popphp.org/license New BSD License

version
5.0.0

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|null

getDir()

Get the cache directory

public getDir() : string
Return values
string

key()

Derive a stable cache key from resolved template content

public static key(string $resolvedTemplate) : string
Parameters
$resolvedTemplate : string
Return values
string

path()

Get the absolute path to the cache file for a given key

public path(string $key) : string
Parameters
$key : string
Return values
string

put()

Write compiled source to the cache, atomically

public put(string $key, string $source) : void
Parameters
$key : string
$source : string
Tags
throws
Exception

        
On this page

Search results