From 22dfbc866fe390fae4bf4ff52d3894f84cca147e Mon Sep 17 00:00:00 2001 From: joshuaruesweg Date: Wed, 21 Oct 2020 19:10:42 +0200 Subject: [PATCH] Use Guzzle to download package archives --- .../system/package/PackageArchive.class.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php index 1e9d500883..7945a37569 100644 --- a/wcfsetup/install/files/lib/system/package/PackageArchive.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageArchive.class.php @@ -1,7 +1,10 @@ archive = FileUtil::downloadFileFromHttp($this->archive, $prefix); + $client = HttpFactory::getDefaultClient(); + $request = new Request('GET', $this->archive); + $response = $client->send($request); + + $file = new File($tmpFile); + while (!$response->getBody()->eof()) { + $file->write($response->getBody()->read(4096)); + } + $file->close(); // unzip tar - $this->archive = self::unzipPackageArchive($this->archive); + $this->archive = self::unzipPackageArchive($tmpFile); return $this->archive; } -- 2.20.1