2017 © Pedro PelĂĄez
 

library shell-react

Run async commands within any interactive shell command

image

clue/shell-react

Run async commands within any interactive shell command

  • Wednesday, June 17, 2015
  • by clue
  • Repository
  • 2 Watchers
  • 16 Stars
  • 400 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 6 Forks
  • 4 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

clue/reactphp-shell

CI status installs on Packagist, (*1)

Run async commands within any interactive shell command, built on top of ReactPHP., (*2)

Note: This project is in beta stage! Feel free to report any issues you encounter., (*3)

Quickstart example

Once installed, you can use the following code to run an interactive bash shell and issue some commands within:, (*4)

<?php

require __DIR__ . '/vendor/autoload.php';

$launcher = new Clue\React\Shell\ProcessLauncher();

$shell = $launcher->createDeferredShell('bash');

$shell->execute('echo -n $USER')->then(function ($result) {
    var_dump('current user', $result);
}, function (Exception $e) {
    echo 'Error: ' . $e->getMessage() . PHP_EOL;
});

$shell->execute('env | sort | head -n10')->then(function ($env) {
    var_dump('env', $env);
}, function (Exception $e) {
    echo 'Error: ' . $e->getMessage() . PHP_EOL;
});

$shell->end();

See also the examples:, (*5)

Install

The recommended way to install this library is through Composer. New to Composer?, (*6)

This will install the latest supported version:, (*7)

composer require clue/shell-react:^0.2

See also the CHANGELOG for details about version upgrades., (*8)

This project aims to run on any platform and thus does not require any PHP extensions and supports running on legacy PHP 5.3 through current PHP 8+. It's highly recommended to use the latest supported PHP version for this project., (*9)

Tests

To run the test suite, you first need to clone this repo and then install all dependencies through Composer:, (*10)

composer install

To run the test suite, go to the project root and run:, (*11)

vendor/bin/phpunit

License

MIT, (*12)

The Versions

17/06 2015

dev-master

9999999-dev https://github.com/clue/php-shell-react

Run async commands within any interactive shell command

  Sources   Download

MIT

The Requires

 

by Christian LĂŒck

async interactive reactphp sheller

17/06 2015

v0.2.0

0.2.0.0 https://github.com/clue/php-shell-react

Run async commands within any interactive shell command

  Sources   Download

MIT

The Requires

 

by Christian LĂŒck

async interactive reactphp sheller

07/12 2014

v0.1.0

0.1.0.0 https://github.com/clue/php-shell-react

Run async commands within any interactive shell command

  Sources   Download

MIT

The Requires

 

by Christian LĂŒck

async interactive reactphp sheller