Documentation

RunkitReloader extends AbstractListener
in package

A runkit-based code reloader, which is pretty much magic.

Table of Contents

$parser  : mixed
$timestamps  : mixed
__construct()  : mixed
Construct a Runkit Reloader.
afterLoop()  : mixed
Called at the end of each loop.
afterRun()  : mixed
Called once after the REPL session ends.
beforeLoop()  : mixed
Called at the start of each loop.
beforeRun()  : mixed
Called once before the REPL session starts.
isSupported()  : bool
Only enabled if Runkit is installed.
onExecute()  : string|null
Called before executing user code.
onInput()  : string|null
Reload code on input.
lintFile()  : bool
Should this file be re-imported?
reload()  : mixed
Look through included files and update anything with a new timestamp.

Properties

Methods

__construct()

Construct a Runkit Reloader.

public __construct() : mixed
Tags
todo

Pass in Parser Factory instance for dependency injection?

Return values
mixed

afterLoop()

Called at the end of each loop.

public afterLoop(Shell $shell) : mixed
Parameters
$shell : Shell
Return values
mixed

afterRun()

Called once after the REPL session ends.

public afterRun(Shell $shell) : mixed
Parameters
$shell : Shell
Return values
mixed

beforeLoop()

Called at the start of each loop.

public beforeLoop(Shell $shell) : mixed
Parameters
$shell : Shell
Return values
mixed

beforeRun()

Called once before the REPL session starts.

public beforeRun(Shell $shell) : mixed
Parameters
$shell : Shell
Return values
mixed

isSupported()

Only enabled if Runkit is installed.

public static isSupported() : bool
Return values
bool

onExecute()

Called before executing user code.

public onExecute(Shell $shell, mixed $code) : string|null
Parameters
$shell : Shell
$code : mixed
Return values
string|null

User code override

onInput()

Reload code on input.

public onInput(Shell $shell, string $input) : string|null
Parameters
$shell : Shell
$input : string
Return values
string|null

User input override

lintFile()

Should this file be re-imported?

private lintFile(string $file) : bool

Use PHP-Parser to ensure that the file is valid PHP.

Parameters
$file : string
Return values
bool

reload()

Look through included files and update anything with a new timestamp.

private reload(Shell $shell) : mixed
Parameters
$shell : Shell
Return values
mixed

Search results