From 8a7ae4f6b9335d6c9736b9e7bf50d34792899976 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Sat, 26 Sep 2020 20:27:24 +0200 Subject: [PATCH] Fix downloading on Windows --- src/Command/FixerApplication.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Command/FixerApplication.php b/src/Command/FixerApplication.php index 987f2172bd..bc6e93159f 100644 --- a/src/Command/FixerApplication.php +++ b/src/Command/FixerApplication.php @@ -372,12 +372,10 @@ private function downloadPhar( $progressBar->setMessage(sprintf('%.2f MB', $totalSize / 1000000), 'fileSize'); $progressBar->start($totalSize); - $destination = new \React\Stream\WritableResourceStream($pharPathResource, $loop); - $body->pipe($destination); - $bytes = 0; - $body->on('data', static function ($chunk) use ($progressBar, &$bytes): void { + $body->on('data', static function ($chunk) use ($pharPathResource, $progressBar, &$bytes): void { $bytes += strlen($chunk); + fwrite($pharPathResource, $chunk); $progressBar->setProgress($bytes); }); });