From 7c841d6bcda275fac6a9fc132174e9100dbe4aa6 Mon Sep 17 00:00:00 2001 From: "dale@MBP" Date: Wed, 7 Apr 2021 17:53:32 +0800 Subject: [PATCH 1/4] Upgrade guzzlehttp/guzzle from ~6.0 to ^7.0 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6431520..159db54 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,7 @@ "require": { "php": ">=5.5.0", "ext-curl": "*", - "guzzlehttp/guzzle": "~6.0" + "guzzlehttp/guzzle": "^7.0" }, "require-dev": { "phpunit/phpunit": "~4.0", From 5d4152cf0f473a1d5ebe7649930efced10db8118 Mon Sep 17 00:00:00 2001 From: "dale@MBP" Date: Wed, 7 Apr 2021 21:34:27 +0800 Subject: [PATCH 2/4] my upyun-sdk --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 159db54..07e9c10 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "upyun/sdk", + "name": "guoxiangke/upyun-sdk", "description": "UPYUN sdk for php", "keywords": ["UPYUN", "sdk"], "type": "library", From 4665d1a1d24a14e6afff511644f6dbe308877f97 Mon Sep 17 00:00:00 2001 From: xiangkeguo Date: Thu, 13 Jan 2022 16:46:12 +0800 Subject: [PATCH 3/4] bug of https://github.com/guzzle/guzzle/issues/2824 --- src/Upyun/Uploader.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Upyun/Uploader.php b/src/Upyun/Uploader.php index 95e6f2f..037b73b 100644 --- a/src/Upyun/Uploader.php +++ b/src/Upyun/Uploader.php @@ -24,7 +24,7 @@ public function __construct(Config $config) public function upload($path, $file, $params, $withAsyncProcess) { - $stream = Psr7\stream_for($file); + $stream = \GuzzleHttp\Psr7\Utils::streamFor($file); $size = $stream->getSize(); $useBlock = $this->needUseBlock($size); @@ -87,7 +87,7 @@ private function pointUpload($path, $stream, $params) 'X-Upyun-Multi-Uuid' => $uuid, 'X-Upyun-Part-Id' => $partId )) - ->withFile(Psr7\stream_for($fileBlock)) + ->withFile(\GuzzleHttp\Psr7\Utils::streamFor($fileBlock)) ->send(); if ($res->getStatusCode() !== 204) { @@ -167,7 +167,7 @@ private function concurrentPointUpload($path, $stream, $params) 'X-Upyun-Multi-Uuid' => $uuid, 'X-Upyun-Part-Id' => $i )) - ->withFile(Psr7\stream_for($fileBlock)) + ->withFile(\GuzzleHttp\Psr7\Utils::streamFor($fileBlock)) ->toRequest(); } }; From a5c513af6abb4a3fa659aebe2447ea2d74e7c2e5 Mon Sep 17 00:00:00 2001 From: xiangkeguo Date: Thu, 13 Jan 2022 16:52:44 +0800 Subject: [PATCH 4/4] up --- src/Upyun/Api/Rest.php | 2 +- src/Upyun/Upyun.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Upyun/Api/Rest.php b/src/Upyun/Api/Rest.php index be4b0a0..53a71a0 100644 --- a/src/Upyun/Api/Rest.php +++ b/src/Upyun/Api/Rest.php @@ -47,7 +47,7 @@ public function request($method, $storagePath) */ public function withFile($file) { - $stream = Psr7\stream_for($file); + $stream = \GuzzleHttp\Psr7\Utils::streamFor($file); $this->file = $stream; return $this; diff --git a/src/Upyun/Upyun.php b/src/Upyun/Upyun.php index e74c6c7..40c5ee3 100644 --- a/src/Upyun/Upyun.php +++ b/src/Upyun/Upyun.php @@ -154,7 +154,7 @@ public function read($path, $saveHandler = null, $params = array()) if (! isset($params['x-upyun-list-iter'])) { if (is_resource($saveHandler)) { - Psr7\copy_to_stream($response->getBody(), Psr7\stream_for($saveHandler)); + Psr7\copy_to_stream($response->getBody(), \GuzzleHttp\Psr7\Utils::streamFor($saveHandler)); return true; } else { return $response->getBody()->getContents();