1
0
mirror of https://github.com/danog/process.git synced 2024-11-30 04:39:04 +01:00

Fix examples/ping-many.php to run correctly on Windows

This commit is contained in:
Niklas Keller 2017-12-05 09:19:00 +01:00
parent 9d271e1be3
commit 67f0e56543

View File

@ -24,7 +24,10 @@ Amp\Loop::run(function () {
$promises = [];
foreach ($hosts as $host) {
$process = new Process("ping -c 5 {$host}");
$command = \DIRECTORY_SEPARATOR === "\\"
? "ping -n 5 {$host}"
: "ping -c 5 {$host}"
$process = new Process($command);
$process->start();
$promises[] = new Amp\Coroutine(show_process_output($process));
}