Repository navigation
Internals 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.
use runtime\interface\IRuntime;interface IRuntimeAPISource 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.
No own constants, enum cases, traits or property declarations. Inherited members are documented on the parent reference page.
| 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 |
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.
public function setInfo(IRuntime $runtime): void;| 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.
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.
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.
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.
AWT Framework Wiki · Home · Installation Guide · Developer Guide · Framework Internals
Philosophy · Architecture · Known discrepancies · Verification
Installation Guide
Developer Guide
- Learning sequence
- First package
- Package structure
- Lifecycle
- Runtimes
- Events and objects
- Routing and controllers
- Views and resources
- Database and models
- Storage and caching
- Configuration and CLI
- Responses and errors
- Extension points
Framework Internals
- Architecture
- Bootstrap
- Packages
- Runtime
- Events and context
- Objects
- HTTP routing and controllers
- Rendering
- Blade integration
- Database
- Models
- Storage and caching
- Settings
- CLI
- Identity and sessions
- Responses
- Errors
- Complete source inventory
Documentation notes