diff options
author | Joas Schilling <coding@schilljs.com> | 2017-11-01 10:57:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-01 10:57:56 +0100 |
commit | defc4bf6a844a72068c98b74f355080325e433cb (patch) | |
tree | 702a4758d01fc70766642741f54a305ec9404c20 /lib/private | |
parent | 3d0eebf936fa449fb781737349075b520c5b8109 (diff) | |
parent | f9a72948071e51f89a82a6ae87c7680f431ae6ec (diff) | |
download | nextcloud-server-defc4bf6a844a72068c98b74f355080325e433cb.tar.gz nextcloud-server-defc4bf6a844a72068c98b74f355080325e433cb.zip |
Merge pull request #6975 from nextcloud/s3-read-object-fopen
use fopen directly when reading objects from s3
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Files/ObjectStore/S3ObjectTrait.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php index 6fb12265cb7..4bfa08a3e59 100644 --- a/lib/private/Files/ObjectStore/S3ObjectTrait.php +++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php @@ -49,12 +49,15 @@ trait S3ObjectTrait { 'Bucket' => $this->bucket, 'Key' => $urn ]); - $command['@http']['stream'] = true; - $result = $client->execute($command); - /** @var StreamInterface $body */ - $body = $result['Body']; + $request = \Aws\serialize($command); + $opts = [ + 'http' => [ + 'header' => $request->getHeaders() + ] + ]; - return $body->detach(); + $context = stream_context_create($opts); + return fopen($request->getUri(), 'r', false, $context); } /** |