]> source.dussan.org Git - nextcloud-server.git/commitdiff
use fopen directly when reading objects from s3 7079/head
authorRobin Appelman <robin@icewind.nl>
Thu, 26 Oct 2017 15:05:09 +0000 (17:05 +0200)
committerBjoern Schiessle <bjoern@schiessle.org>
Mon, 6 Nov 2017 09:39:52 +0000 (10:39 +0100)
Signed-off-by: Robin Appelman <robin@icewind.nl>
lib/private/Files/ObjectStore/S3ObjectTrait.php

index 6fb12265cb7ca1c072388b26d2cac6869387d5e4..4bfa08a3e59751cf1ef72caf29568637bc1a7d2f 100644 (file)
@@ -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);
        }
 
        /**