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.
Synopsis
Section titled “Synopsis”final class SapiRuntime implements WorkerRuntimeInterface
| Implements | WorkerRuntimeInterface |
| Source | Runtime/Worker/SapiRuntime.php |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(ResponseEmitterInterface $emitter = new SapiEmitter(…)): mixed
| Parameter | Type | Description |
|---|---|---|
$emitter | ResponseEmitterInterface |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
alias(): string | The registry alias: “sapi”. |
capabilities(): WorkerRuntimeCapabilities | SAPI-shaped and non-persistent: the process serves exactly one request. |
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. |
isSupported(): bool | Always true: this runtime claims every process, so WorkerRuntimeRegistry::detect() can never come back empty-handed. |
run(WorkerLoop $loop): void | Handles the single request built from the superglobals and emits it. |
alias()
Section titled “alias()”public static function alias(): string
The registry alias: “sapi”.
Returns string
capabilities()
Section titled “capabilities()”public function capabilities(): WorkerRuntimeCapabilities
SAPI-shaped and non-persistent: the process serves exactly one request.
Returns WorkerRuntimeCapabilities
detectionPriority()
Section titled “detectionPriority()”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
isSupported()
Section titled “isSupported()”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.
| Parameter | Type | Description |
|---|---|---|
$loop | WorkerLoop |