-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[WCM] Documentation for setProcessPipes() #3303
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -257,6 +257,24 @@ When running a program asynchronously, you can send it posix signals with the | |
POSIX signals are not available on Windows platforms, please refer to the | ||
`PHP documentation`_ for available signals. | ||
|
||
Redirecting output to /dev/null | ||
------------------------------ | ||
.. versionadded:: 2.4The ``setProcessPipes`` method was added in Symfony 2.4. | ||
|
||
Occasionally the output of a process is not important because you are | ||
communicating with it via other means. In these cases it can be helpful | ||
to redirect the output to /dev/null to avoid blocking on full pipes. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /dev/null should be in a literal (double backticks) |
||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add |
||
use Symfony\Component\Process\Process; | ||
use Symfony\Component\Process\NullProcessPipes; | ||
|
||
$process = new Process('find / -name "rabbit"'); | ||
$process->setProcessPipes(new NullProcessPipes); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should become |
||
$process->run(); | ||
|
||
$process->getOutput() // Will be empty, but this process will never block on output! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing semi-colon |
||
|
||
Process Pid | ||
----------- | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should have an empty line before this and the text should go on a new line indented by 4 spaces.
Also, this is never going to be in 2.4 as it is already released and no more features will be added in the the 2.4.* serie.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and can you use an API link? (also note using "was introduced in")