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

[WCM] Documentation for setProcessPipes() #3303

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions components/process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

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.

Copy link
Member

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")

The :method:`Symfony\\Component\\Process\\Process::setProcessPipes` method was introduced
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/dev/null should be in a literal (double backticks)



Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add .. code-block:: php It's a quote now, not a code block

use Symfony\Component\Process\Process;
use Symfony\Component\Process\NullProcessPipes;

$process = new Process('find / -name "rabbit"');
$process->setProcessPipes(new NullProcessPipes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should become NullProcessPipes()

$process->run();

$process->getOutput() // Will be empty, but this process will never block on output!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing semi-colon


Process Pid
-----------

Expand Down