Skip to content

Commit c2ac9b5

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

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/GridFS/Bucket.php

Lines changed: 5 additions & 0 deletions
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.10', '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,

src/GridFS/WritableStream.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
use function sprintf;
3737
use function strlen;
3838
use function substr;
39+
use function trigger_deprecation;
3940

4041
/**
4142
* WritableStream abstracts the process of writing a GridFS file.

0 commit comments

Comments
 (0)