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)

Push a compiled view path onto the stack.

void
popCompiledPath()

Pop the current compiled view path from the stack.

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.

static void
flushState()

Flush all static state.

Details

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

Create a new compiler engine instance.

Parameters

CompilerInterface $compiler
Filesystem $files

at line 48
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 112
protected void handleViewException(Throwable $e, int $obLevel)

Handle a view exception.

Parameters

Throwable $e
int $obLevel

Return Value

void

Exceptions

Throwable

at line 90
protected void pushCompiledPath(string $path)

Push a compiled view path onto the stack.

Parameters

string $path

Return Value

void

at line 100
protected void popCompiledPath()

Pop the current compiled view path from the stack.

Return Value

void

at line 131
protected string getMessage(Throwable $e)

Get the exception message for an exception.

Parameters

Throwable $e

Return Value

string

at line 141
CompilerInterface getCompiler()

Get the compiler implementation.

Return Value

CompilerInterface

at line 153
static void forgetCompiledOrNotExpired()

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

Boot or tests only when called directly. Clears the worker-wide compile-check cache shared by every coroutine; concurrent compilations may re-check disk redundantly. The view:clear command owns runtime invalidation.

Return Value

void

at line 161
static void flushState()

Flush all static state.

Return Value

void