From: Robin Appelman Date: Thu, 26 Oct 2017 15:05:09 +0000 (+0200) Subject: use fopen directly when reading objects from s3 X-Git-Tag: v12.0.4RC1~31^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1ed9a25ae8bad58446b9c638993393aeab17923f;p=nextcloud-server.git use fopen directly when reading objects from s3 Signed-off-by: Robin Appelman --- 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); } /**