Darken\Code\Runtime

class

The context which ALL compile code runs and is injected into the __constructor as __construct(Runtime $runtime) lowest level of runtime is component runtime

Methods

Method Details

public string __toString () Runtime.php#26

If the runtime is used as a string (using echo), the render() method is invoken. If the render() method returns an instance of ResponseInterface, the body of the response is returned as string by default.

Return string
public string renderFilePath () Runtime.php#34

The path to the compiled file that will be executed from the render() method inside the runtime polyfill.

Return string
public void setData (string $section, string $key, mixed $value) Runtime.php#39

Exchange Bus between Runtime Polyfill and Compiled Code. Set data in the polyfill and access it in the compiled code.

$section string
$key string
$value mixed
Return void
public mixed getData (string $section, string $key, mixed $defaultValue) Runtime.php#48

Exchange Bus between Runtime Polyfill and Compiled Code. Get data in the compiled code that was set in the polyfill.

$section string
$key string
$defaultValue mixed
Return mixed
public object getContainer ($className) Runtime.php#56

Access the Kernels DI Container Service

$className
Return object
public Darken\Web\Request getRequest () Runtime.php#64

Helper method to access the Request object, resolved from the DI Container.

Return Darken\Web\Request
public self make (string $className, array $params) Runtime.php#75

Create a new runtime instances. This "helper" ensures an object of type runtime (self) is returned and therefore the recommend way to create a new runtime instance.

$className string
$params array
Return self
public string|Psr\Http\Message\ResponseInterface render () Runtime.php#83

Renders the compiled file from renderFilePath() as string or ResponseInterface.

Return string|Psr\Http\Message\ResponseInterface