Skip to content
Snippets Groups Projects
Unverified Commit f9a72948 authored by Robin Appelman's avatar Robin Appelman
Browse files

use fopen directly when reading objects from s3


Signed-off-by: default avatarRobin Appelman <robin@icewind.nl>
parent 13087da3
No related branches found
No related tags found
No related merge requests found
...@@ -49,12 +49,15 @@ trait S3ObjectTrait { ...@@ -49,12 +49,15 @@ trait S3ObjectTrait {
'Bucket' => $this->bucket, 'Bucket' => $this->bucket,
'Key' => $urn 'Key' => $urn
]); ]);
$command['@http']['stream'] = true; $request = \Aws\serialize($command);
$result = $client->execute($command); $opts = [
/** @var StreamInterface $body */ 'http' => [
$body = $result['Body']; 'header' => $request->getHeaders()
]
];
return $body->detach(); $context = stream_context_create($opts);
return fopen($request->getUri(), 'r', false, $context);
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment