Merge pull request #6975 from nextcloud/s3-read-object-fopen

use fopen directly when reading objects from s3
pull/6957/merge
Joas Schilling 7 years ago committed by GitHub
commit defc4bf6a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);
}
/**

Loading…
Cancel
Save