class CompilerEngine extends PhpEngine

Constants

COMPILED_PATH_CONTEXT_KEY

The context key for a stack of the compiled template path.

Properties

static protected array<string, true> $compiledOrNotExpired

The view paths that were compiled or are not expired, keyed by the path.

Methods

__construct(CompilerInterface $compiler, Filesystem $files = null)

Create a new compiler engine instance.

string
get(string $path, array $data = [])

Get the evaluated contents of the view.

string
evaluatePath(string $path, array $data)

Get the evaluated contents of the view at the given path.

void
handleViewException(Throwable $e, int $obLevel)

Handle a view exception.

void
pushCompiledPath(string $path)

No description

void
popCompiledPath()

No description

string
getMessage(Throwable $e)

Get the exception message for an exception.

getCompiler()

Get the compiler implementation.

static void
forgetCompiledOrNotExpired()

Clear the cache of views that were compiled or not expired.

Details

at line 35
__construct(CompilerInterface $compiler, Filesystem $files = null)

Create a new compiler engine instance.

Parameters

CompilerInterface $compiler
Filesystem $files

at line 47
string get(string $path, array $data = [])

Get the evaluated contents of the view.

Parameters

string $path
array $data

Return Value

string

Exceptions

ViewException

in PhpEngine at line 32
protected string evaluatePath(string $path, array $data)

Get the evaluated contents of the view at the given path.

Parameters

string $path
array $data

Return Value

string

at line 104
protected void handleViewException(Throwable $e, int $obLevel)

Handle a view exception.

Parameters

Throwable $e
int $obLevel

Return Value

void

Exceptions

Throwable

at line 85
protected void pushCompiledPath(string $path)

No description

Parameters

string $path

Return Value

void

at line 92
protected void popCompiledPath()

No description

Return Value

void

at line 122
protected string getMessage(Throwable $e)

Get the exception message for an exception.

Parameters

Throwable $e

Return Value

string

at line 132
CompilerInterface getCompiler()

Get the compiler implementation.

Return Value

CompilerInterface

at line 143
static void forgetCompiledOrNotExpired()

Clear the cache of views that were compiled or not expired.

Boot or tests only. Clears the worker-wide compile-check cache shared by every coroutine; concurrent compilations may re-check disk redundantly.

Return Value

void