tacoberu/php-process

用于调用进程的包装器。

v0.2.0 2019-07-20 20:42 UTC

This package is auto-updated.

Last update: 2024-09-21 20:59:13 UTC


README

对象帮助处理指定要执行的进程的命令行。具有流畅的接口。

使用

$res = (new Process\Exec('ping 127.0.0.1 -c 3'))->run();


$res = (new Process\Exec('ping'))
    ->arg('127.0.0.1')
    ->arg('-c 3');
    ->run();
echo "{$res->code}\n{$res->content}\n";


$code = (new Process\Exec('bin/readwrite.php'))
    ->run(function($out, $err) {
    echo '> ' . $out;
        return "Hi\n";
    });