rackspace / php-opencloud

The PHP SDK for OpenStack clouds
developer.rackspace.com
Other
451 stars 250 forks source link

stream support isn't really streaming... #743

Open fusionfoto opened 4 years ago

fusionfoto commented 4 years ago

It appears, that when wants to access a large (>5GB) object via stream...

$objectContent = $file->getContent(); $objectContent->rewind(); echo (stream_get_contents ($objectContent ->getStream(), 500000,0));

The entire file is pulled from the object store and written to /tmp before streaming can begin... so we are basically just opening a local file as a stream. Since Swift already supports offset calling, this request (seek, read to offset, etc) could actually be done by an autonomic call directly to swift. I'm not sure the library is adding any value here.

Has anyone else flagged this behavior and is this the way its "supposed" to be?

thanks in advance!