Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Clarify Process::wait() callback behaviour#7099

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Lilchef wants to merge2 commits intosymfony:3.1fromLilchef:patch-1
Closed
Changes fromall commits
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
23 changes: 17 additions & 6 deletionscomponents/process.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -132,7 +132,24 @@ are done doing other stuff::
$process->start();

// ... do other things

$process->wait();

// ... do things after the process has finished

.. note::

The :method:`Symfony\\Component\\Process\\Process::wait` method is blocking,
which means that your code will halt at this line until the external
process is completed.

:method:`Symfony\\Component\\Process\\Process::wait` takes one optional argument:
a callback that is called repeatedly whilst the process is still running, passing
in the output and its type::

$process = new Process('ls -lsa');
$process->start();

$process->wait(function ($type, $buffer) {
if (Process::ERR === $type) {
echo 'ERR > '.$buffer;
Expand All@@ -141,12 +158,6 @@ are done doing other stuff::
}
});

.. note::

The :method:`Symfony\\Component\\Process\\Process::wait` method is blocking,
which means that your code will halt at this line until the external
process is completed.

Streaming to the Standard Input of a Process
--------------------------------------------

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp