mirror of
https://github.com/danog/process.git
synced 2024-12-13 01:27:26 +01:00
17 lines
352 B
PHP
17 lines
352 B
PHP
<?php
|
|
|
|
include dirname(__DIR__) . "/vendor/autoload.php";
|
|
|
|
use Amp\ByteStream\Message;
|
|
use Amp\Process\Process;
|
|
|
|
Amp\Loop::run(function () {
|
|
$process = new Process("echo 'Hello, world!'");
|
|
$process->start();
|
|
|
|
echo yield new Message($process->getStdout());
|
|
|
|
$code = yield $process->join();
|
|
echo "Process exited with {$code}.\n";
|
|
});
|