Skip to content

Internals Runtime RuntimeLoader

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

runtime\RuntimeLoader

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/runtime/RuntimeLoader.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 package\model\service\interface\IPackageService;
use runtime\interface\IRuntimeCreator;
use runtime\interface\IRuntimeLoader;

RuntimeLoader

Declaration and architectural role

class RuntimeLoader implements IRuntimeLoader

Constants, enum cases, traits and properties

Declarations below preserve visibility, type, default and modifiers exactly. A typed property without an initializer remains uninitialized until its constructor or another method assigns it. Mutable fields belong to this instance unless marked static; readonly fields can be initialized once. Constructor-promoted properties are also listed below.

Member Declaration Purpose or source contract
$runtimes public array $runtimes = []; Used by load(), getLoaded().
Constructor-promoted public function __construct(private IPackageService $packageService Initialized from the constructor argument; default expression is evaluated when the argument is omitted.
Constructor-promoted private IRuntimeCreator $runtimeCreator) Initialized from the constructor argument; default expression is evaluated when the argument is omitted.

Method index

Method Signature
__construct public function __construct(private IPackageService $packageService, private IRuntimeCreator $runtimeCreator)
load public function load(): void
getLoaded public function getLoaded(): array

__construct

Source line 9

public function __construct(private IPackageService $packageService, private IRuntimeCreator $runtimeCreator);

Parameters

Parameter Type, modifiers and default Purpose
$packageService private IPackageService $packageService Operation input; the exact use, validation and propagation are shown in the implementation trace.
$runtimeCreator private IRuntimeCreator $runtimeCreator Operation input; the exact use, validation and propagation are shown in the implementation trace.

Concrete no-op/default hook: this method performs no work. Override it where the lifecycle or extension contract calls for behavior.

load

Source line 10

public function load(): void

State writes: $this->runtimes, $this->runtimes[].

Implementation, validation guards and interaction order
public function load(): void
    {
        $this->runtimes = [];
        foreach ($this->packageService->getActive() as $package) {
            if ($package->getType() !== 0) $this->runtimes[] = $this->runtimeCreator->create($package);
        }
    }

getLoaded

Source line 17

public function getLoaded(): array

Return expressions (including local callbacks): $this->runtimes.

Implementation, validation guards and interaction order
public function getLoaded(): array { return $this->runtimes; }

Related types

Clone this wiki locally