Skip to content

Commit 8a7ae4f

Browse files
committed
Fix downloading on Windows
1 parent 2d8dcd1 commit 8a7ae4f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/Command/FixerApplication.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,10 @@ private function downloadPhar(
372372
$progressBar->setMessage(sprintf('%.2f MB', $totalSize / 1000000), 'fileSize');
373373
$progressBar->start($totalSize);
374374

375-
$destination = new \React\Stream\WritableResourceStream($pharPathResource, $loop);
376-
$body->pipe($destination);
377-
378375
$bytes = 0;
379-
$body->on('data', static function ($chunk) use ($progressBar, &$bytes): void {
376+
$body->on('data', static function ($chunk) use ($pharPathResource, $progressBar, &$bytes): void {
380377
$bytes += strlen($chunk);
378+
fwrite($pharPathResource, $chunk);
381379
$progressBar->setProgress($bytes);
382380
});
383381
});

0 commit comments

Comments
 (0)