Skip to content

Commit 0af98cd

Browse files
committed
Fix documentation about StorageObject::download()
1 parent 52528bb commit 0af98cd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

doc/services/object-store/v1/objects.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ Download an object
3232
As you will notice, a Stream_ object is returned by this call. For more information about dealing with streams, please
3333
consult `Guzzle's docs`_.
3434

35+
By default, the whole body of the object is fetched before the function returns, set the ``'guzzle'`` key of parameter
36+
``$data`` to ``['stream' => true]`` to get the stream before the end of download.
37+
3538
.. _Stream: https://github.com/guzzle/streams/blob/master/src/Stream.php
3639
.. _Guzzle's docs: https://guzzle.readthedocs.org/en/5.3/streams.html
3740

src/ObjectStore/v1/Models/StorageObject.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ public function retrieve()
133133
/**
134134
* This call will perform a `GET` HTTP request for the given object and return back its content in the form of a
135135
* Guzzle Stream object. Downloading an object will transfer all of the content for an object, and is therefore
136-
* distinct from fetching its metadata (a `HEAD` request). The body of an object is not fetched by default to
137-
* improve performance when handling large objects.
136+
* distinct from fetching its metadata (a `HEAD` request). The whole body of the object is fetched before the
137+
* function returns, set the `'guzzle'` key of {@param $data} to `['stream' => true]` to get the stream before the
138+
* end of download.
138139
*
139140
* @param array $data {@see \OpenStack\ObjectStore\v1\Api::getObject}
140141
*/

0 commit comments

Comments
 (0)