API reference / Quittio \ Core \ Support
Process
final class in quittio/core
Quittio\Core\Support\Process · Source
Minimal external process runner with stdin, timeout and captured output.
Methods#
| Method | Description |
|---|---|
::open() | proc_open() that reports a program that cannot be started (e.g. java, verapdf or docker not installed) as RuntimeException, also where PHP warnings become exceptions (Laravel), so that validators can report themselves as unavailable. |
::run() |
open()#
public static function open(
list<string> $command,
array<int, list<string>> $descriptors,
array<int, resource>|null &$pipes,
): resourceproc_open() that reports a program that cannot be started (e.g. java, verapdf or docker not installed) as RuntimeException, also where PHP warnings become exceptions (Laravel), so that validators can report themselves as unavailable.
| Parameter | Type | Description |
|---|---|---|
$command | list<string> | |
$descriptors | array<int, list<string>> | |
$pipes | array<int, resource>|null |
- Returns
resource
run()#
public static function run(
list<string> $command,
?string $input = null,
int $timeout = 60,
): array{exitCode: int, stdout: string, stderr: string}| Parameter | Type | Description |
|---|---|---|
$command | list<string> | |
$input | ?string = null | |
$timeout | int = 60 |
- Returns
array{exitCode: int, stdout: string, stderr: string}