From f9a72948071e51f89a82a6ae87c7680f431ae6ec Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 26 Oct 2017 17:05:09 +0200 Subject: [PATCH] use fopen directly when reading objects from s3 Signed-off-by: Robin Appelman --- lib/private/Files/ObjectStore/S3ObjectTrait.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php index 6fb12265cb..4bfa08a3e5 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); } /**