Skip to content

Internals Runtime Interface Api IRuntimeAPI

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

runtime\interface\api\IRuntimeAPI

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/runtime/interface/api/IRuntimeAPI.php · Snapshot 8411f4287706.

Runtime state, package API classes, loader, executor and orchestrator have separate responsibilities. Dependency validation precedes package code and nested execution restores context.

Imports and dependencies

use runtime\interface\IRuntime;

IRuntimeAPI

Declaration and architectural role

interface IRuntimeAPI

Source description (behavioral corrections are recorded in Known discrepancies):

Provides a set of methods that are called by the RuntimeExecutor to set up and execute the runtime.

Constants, enum cases, traits and properties

No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.

Method index

Method Signature
getRuntime public function getRuntime(): IRuntime
setInfo public function setInfo(IRuntime $runtime): void
environmentSetup public function environmentSetup(): void
setup public function setup(): void
main public function main(): void

getRuntime

Source line 38

public function getRuntime(): IRuntime;

@return IRuntime

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

setInfo

Source line 45

public function setInfo(IRuntime $runtime): void;

Parameters

Parameter Type, modifiers and default Purpose
$runtime IRuntime $runtime Base runtime object containing universal information about the runtime.

This method is called by RuntimeExecutor to set the runtime information. @param IRuntime $runtime Base runtime object containing universal information about the runtime. @return void

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

environmentSetup

Source line 53

public function environmentSetup(): void;

This method is called by RuntimeExecutor to set up the runtime environment. Should be used to set RuntimeFlags, waitForPackages and addCommand. If another developer is modifying this method through inheritance, make sure to call the parent method. @return void

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

setup

Source line 65

public function setup(): void;

This method is called by RuntimeExecutor to prepare the main() method. This method can be empty; its primary purpose is to provide a way for a developer to create a custom setup without modifying the base class environmentSetup(). Examples:

  • Create factories
  • Create routes
  • Create controllers
  • Create and add event listeners @return void

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

main

Source line 81

public function main(): void;

This method is called by RuntimeExecutor to execute the main logic of the runtime.

Can be empty if the runtime only provides dependencies to other packages. When implemented, it should contain the runtime's core purposes and logic.

Examples:

  • Register controllers
  • Register routes
  • Link other runtimes
  • Dispatch events

@return void

Contract only: implementations supply the behavior. Parameter and return types are enforced by PHP; caller and implementation constraints follow the subsystem overview.

Related types

Clone this wiki locally