summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2017-10-26 17:05:09 +0200
committerRobin Appelman <robin@icewind.nl>2017-10-27 12:58:19 +0200
commitf9a72948071e51f89a82a6ae87c7680f431ae6ec (patch)
tree9fc8c6ee31d49f1613e16cd4bb1eafa17c201991 /lib/private
parent13087da3c66449caee51450619b386d605964383 (diff)
downloadnextcloud-server-f9a72948071e51f89a82a6ae87c7680f431ae6ec.tar.gz
nextcloud-server-f9a72948071e51f89a82a6ae87c7680f431ae6ec.zip
use fopen directly when reading objects from s3
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Files/ObjectStore/S3ObjectTrait.php13
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);
}
/**