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:
parent
9d271e1be3
commit
67f0e56543
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user