From 1be388e05bad10441bfde65f220d4033c180643e Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 1 Feb 2017 10:53:09 -0500 Subject: [PATCH 1/2] Fix GridFS tutorial examples to read a stream's contents --- docs/tutorial/gridfs.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorial/gridfs.txt b/docs/tutorial/gridfs.txt index 61070d861..b2f052bdf 100644 --- a/docs/tutorial/gridfs.txt +++ b/docs/tutorial/gridfs.txt @@ -87,7 +87,7 @@ To open a download stream and read from it: $bucket = (new MongoDB\Client)->example->selectGridFSBucket(); $stream = $bucket->openDownloadStream($fileId); - $contents = file_get_contents($stream); + $contents = stream_get_contents($stream); To download the file all at once and write it to an writable stream: @@ -136,7 +136,7 @@ particular file: $bucket = (new MongoDB\Client)->example->selectGridFSBucket(); $stream = $bucket->openDownloadStreamByName('my-file.txt', ['revision' => 0]); - $contents = file_get_contents($stream); + $contents = stream_get_contents($stream); Deleting Files -------------- From cd1166b928c458b19f0509f3b262a75c62f785ab Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Wed, 1 Feb 2017 10:53:39 -0500 Subject: [PATCH 2/2] Fix typo in GridFS tutorial --- docs/tutorial/gridfs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorial/gridfs.txt b/docs/tutorial/gridfs.txt index b2f052bdf..d302fcbf7 100644 --- a/docs/tutorial/gridfs.txt +++ b/docs/tutorial/gridfs.txt @@ -89,7 +89,7 @@ To open a download stream and read from it: $stream = $bucket->openDownloadStream($fileId); $contents = stream_get_contents($stream); -To download the file all at once and write it to an writable stream: +To download the file all at once and write it to a writable stream: .. code-block:: php