Skip to content
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

Look into non-console I/O #16

Closed
clue opened this issue May 17, 2015 · 2 comments · Fixed by #57
Closed

Look into non-console I/O #16

clue opened this issue May 17, 2015 · 2 comments · Fixed by #57

Comments

@clue
Copy link
Owner

clue commented May 17, 2015

  • Process pipes
  • Remote telnet console
  • etc.
@clue
Copy link
Owner Author

clue commented Jun 10, 2016

posix_isatty() may help here. See also http://stackoverflow.com/questions/11327367/detect-if-a-php-script-is-being-run-interactively-or-not

This could also affect MS Windows support (#18).

# pipe input
echo input | php example.php

# pipe interactive input
cat | php example.php

# pipe output
php example.php | cat

# closed input pipe
php example.php 0<&-

@clue
Copy link
Owner Author

clue commented Oct 31, 2017

For the reference: The last example has actually lead to discovering a bug in PHP:

# bugged: closed input pipe
php example.php 0<&-

# instead: null input pipe
php example.php </dev/null

See also reactphp/stream#81 and the upstream bug report https://bugs.php.net/bug.php?id=74252.

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

Successfully merging a pull request may close this issue.

1 participant