Skip to content

Commit da4feb3

Browse files
committed
Deprecate setting GridFS disableMD5 to false explicitly
1 parent 92e0a10 commit da4feb3

5 files changed

+9
-4
lines changed

docs/reference/method/MongoDBDatabase-selectGridFSBucket.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Parameters
4848
- boolean
4949
- Whether to disable automatic MD5 generation when storing files.
5050

51-
Defaults to ``false``.
51+
Defaults to ``false``. Only ``true`` will be supported in 2.0.
5252

5353
.. versionadded: 1.4
5454

docs/reference/method/MongoDBGridFSBucket-openUploadStream.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Parameters
5555
- boolean
5656
- Whether to disable automatic MD5 generation when storing files.
5757

58-
Defaults to ``false``.
58+
Defaults to ``false``. Only ``true`` will be supported in 2.0.
5959

6060
.. versionadded: 1.4
6161

docs/reference/method/MongoDBGridFSBucket-uploadFromStream.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Parameters
5959
- boolean
6060
- Whether to disable automatic MD5 generation when storing files.
6161

62-
Defaults to ``false``.
62+
Defaults to ``false``. Only ``true`` will be supported in 2.0.
6363

6464
.. versionadded: 1.4
6565

docs/reference/method/MongoDBGridFSBucket__construct.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Parameters
5959
- boolean
6060
- Whether to disable automatic MD5 generation when storing files.
6161

62-
Defaults to ``false``.
62+
Defaults to ``false``. Only ``true`` will be supported in 2.0.
6363

6464
.. versionadded: 1.4
6565

src/GridFS/Bucket.php

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
use function stream_copy_to_stream;
6262
use function stream_get_meta_data;
6363
use function stream_get_wrappers;
64+
use function trigger_deprecation;
6465
use function urlencode;
6566

6667
/**
@@ -132,6 +133,10 @@ class Bucket
132133
*/
133134
public function __construct(Manager $manager, string $databaseName, array $options = [])
134135
{
136+
if (isset($options['disableMD5']) && $options['disableMD5'] === false) {
137+
trigger_deprecation('mongodb/mongodb', '1.18', 'Setting GridFS "disableMD5" option to "false" is deprecated and will not be supported in version 2.0.');
138+
}
139+
135140
$options += [
136141
'bucketName' => self::DEFAULT_BUCKET_NAME,
137142
'chunkSizeBytes' => self::DEFAULT_CHUNK_SIZE_BYTES,

0 commit comments

Comments
 (0)