Skip to content

SapiRuntime

The classic one-request-per-process host: php-fpm, mod_php, php -S, and the CLI when something calls Kernel::run() directly.

Always supported, at the lowest possible detection priority, so WorkerRuntimeRegistry::detect() can never come back empty-handed.

final class SapiRuntime implements WorkerRuntimeInterface

ImplementsWorkerRuntimeInterface
SourceRuntime/Worker/SapiRuntime.php

public function __construct(ResponseEmitterInterface $emitter = new SapiEmitter(…)): mixed

ParameterTypeDescription
$emitterResponseEmitterInterface

Returns mixed

MethodDescription
alias(): stringThe registry alias: “sapi”.
capabilities(): WorkerRuntimeCapabilitiesSAPI-shaped and non-persistent: the process serves exactly one request.
detectionPriority(): intPHP_INT_MIN: the lowest possible priority, so any other supported runtime outranks this one and it is only chosen when nothing else claims the process.
isSupported(): boolAlways true: this runtime claims every process, so WorkerRuntimeRegistry::detect() can never come back empty-handed.
run(WorkerLoop $loop): voidHandles the single request built from the superglobals and emits it.

public static function alias(): string

The registry alias: “sapi”.

Returns string

public function capabilities(): WorkerRuntimeCapabilities

SAPI-shaped and non-persistent: the process serves exactly one request.

Returns WorkerRuntimeCapabilities

public static function detectionPriority(): int

PHP_INT_MIN: the lowest possible priority, so any other supported runtime outranks this one and it is only chosen when nothing else claims the process.

Returns int

public static function isSupported(): bool

Always true: this runtime claims every process, so WorkerRuntimeRegistry::detect() can never come back empty-handed.

Returns bool

public function run(WorkerLoop $loop): void

Handles the single request built from the superglobals and emits it.

There is no loop and no request-boundary reset: the process ends with the response, so nothing can leak into a next request.

ParameterTypeDescription
$loopWorkerLoop