1
0
mirror of https://github.com/danog/process.git synced 2025-01-22 05:41:17 +01:00
process/examples/basic-command.php

16 lines
338 B
PHP
Raw Normal View History

<?php
include dirname(__DIR__) . "/vendor/autoload.php";
2017-06-15 12:02:50 -05:00
use Amp\ByteStream\Message;
use Amp\Process\Process;
2017-06-15 12:11:38 -05:00
Amp\Loop::run(function () {
$process = yield Process::start("echo 'Hello, world!'");
echo yield new Message($process->getStdout());
2017-06-15 12:02:50 -05:00
$code = yield $process->join();
2017-01-15 09:30:34 -06:00
echo "Process exited with {$code}.\n";
});