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

Component\Process\Process reads stream input only once on Process::start/run #18262

Closed
akomm opened this issue Mar 22, 2016 · 2 comments
Closed

Comments

@akomm
Copy link

akomm commented Mar 22, 2016

I want to implement a Command, which starts a child Process and interacts with it at certain points by writing into its STDIN. I did similar with proc_open a while ago and I know it is possible with the process API, which PHP provides, using the nonblocking option and pseudo terminal. The Process component provides an "async" API to run a process, but no means to write to the STDIN during the execution. Only once at start time.

The entire testcase only checks the stream feature writing to the stream prior the execution:

https://github.com/romainneutron/symfony/blob/e19ce573bc26f64fec610181cd96425af54389fa/src/Symfony/Component/Process/Tests/AbstractProcessTest.php#L164-L181

Not during.

@nicolas-grekas
Copy link
Member

This is not supported today but could be with #18262

fabpot added a commit that referenced this issue Mar 31, 2016
This PR was merged into the 3.1-dev branch.

Discussion
----------

[Process] Accept Traversable input

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18262
| License       | MIT
| Doc PR        | -

Commits
-------

b9782b7 [Process] Accept Traversable input
@fabpot fabpot closed this as completed Mar 31, 2016
@nicolas-grekas
Copy link
Member

See also #18386

fabpot added a commit that referenced this issue Apr 2, 2016
…rocesses (nicolas-grekas)

This PR was merged into the 3.1-dev branch.

Discussion
----------

[Process] Add InputStream to seamlessly feed running processes

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18262
| License       | MIT
| Doc PR        | symfony/symfony-docs#6424

Look at the tests, beautiful, isn't it?

Commits
-------

3d20b6c [Process] Add InputStream to seamlessly feed running processes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants