googleapis / google-cloud-php

Google Cloud Client Library for PHP
https://cloud.google.com/php/docs/reference
Apache License 2.0
1.08k stars 430 forks source link

fix(Storage): ensure streams arent copied by default #7495

Closed bshaffer closed 1 week ago

bshaffer commented 2 weeks ago

Attempts to address https://github.com/googleapis/google-cloud-php/issues/7473 by not copying streams by default. This was copying the full streams even when the stream was only supposed to be opened.

The new code copies the stream only if retries took place. Admittedly this also isn't optimal behavior - it would be better to return a new stream which prepends any previous streams (without seeking through the new stream). We should investigate the Stream classes being used to see if it's possible to do something like this.