From 1ed9a25ae8bad58446b9c638993393aeab17923f 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 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); } /** -- 2.39.5