<?php
require __DIR__ . '/vendor/autoload.php';
$loop = React\EventLoop\Factory::create(); #this
$launcher = new Clue\React\Shell\ProcessLauncher($loop);
$shell = $launcher->createDeferredShell('bash');
$shell->execute('echo -n $USER')->then(function ($result) {
var_dump('current user', $result);
});
$shell->execute('env | sort | head -n10')->then(function ($env) {
var_dump('env', $env);
});
$shell->end();
$loop->run(); #and this