8000 Please update your code in README.md and example · Issue #18 · clue/reactphp-shell · GitHub
[go: up one dir, main page]

Skip to content

Please update your code in README.md and example #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dannsbass opened this issue Sep 30, 2023 · 1 comment
Open

Please update your code in README.md and example #18

dannsbass opened this issue Sep 30, 2023 · 1 comment

Comments

@dannsbass
Copy link
Screenshot 2023-09-30 173844

I think you miss the $loop in your code:

<?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
@yadaiio
Copy link
Contributor
yadaiio commented Oct 23, 2023

Hi @dannsbass,

I noticed that you have installed v0.2.0, but it seems like you are referring to the documentation for the upcoming v0.3.0.

Please refer to the documentation for the installed v0.2.0, or consider installing the development version of clue/reactphp-shell. The development version uses the default loop, aligning with the current README. You can find more information in PR #16.

I hope this solution will work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0