Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "upyun/sdk",
"name": "guoxiangke/upyun-sdk",
"description": "UPYUN sdk for php",
"keywords": ["UPYUN", "sdk"],
"type": "library",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/Upyun/Api/Rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/Upyun/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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();
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/Upyun/Upyun.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down