Zum Inhalt springen

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#

MethodDescription
::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,
): resource

static

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.

ParameterTypeDescription
$commandlist<string>
$descriptorsarray<int, list<string>>
$pipesarray<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}

static

ParameterTypeDescription
$commandlist<string>
$input?string = null
$timeoutint = 60
Returns
array{exitCode: int, stdout: string, stderr: string}

Die Open-Core-Pakete stehen unter der MIT-Lizenz. Die rechtlichen Formulierungen der Länderpakete sind mit einer Steuerberatung abzustimmen.