8000 GitHub - TheTechsTech/php-shell-react: Run async commands within any interactive shell command, built on top of React PHP
[go: up one dir, main page]

Skip to content

Run async commands within any interactive shell command, built on top of React PHP

License

Notifications You must be signed in to change notification settings

TheTechsTech/php-shell-react

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clue/shell-react Build Status

Run async commands within any interactive shell command, built on top of React PHP.

Note: This project is in beta stage! Feel free to report any issues you encounter.

Quickstart example

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

$loop = React\EventLoop\Factory::create();
$launcher = new 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();

See also the examples:

Install

The recommended way to install this library is through composer. New to composer?

{
    "require": {
        "clue/shell-react": "~0.2.0"
    }
}

License

MIT

About

Run async commands within any interactive shell command, built on top of React PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%
0