Skip to content

Commit

Permalink
Deprecate setting GridFS disableMD5 to false explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Jan 3, 2024
1 parent 92e0a10 commit c2ac9b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/GridFS/Bucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
use function stream_copy_to_stream;
use function stream_get_meta_data;
use function stream_get_wrappers;
use function trigger_deprecation;
use function urlencode;

/**
Expand Down Expand Up @@ -132,6 +133,10 @@ class Bucket
*/
public function __construct(Manager $manager, string $databaseName, array $options = [])
{
if (isset($options['disableMD5']) && $options['disableMD5'] === false) {
trigger_deprecation('mongodb/mongodb', '1.10', 'Setting GridFS "disableMD5" option to "false" is deprecated and will not be supported in version 2.0.');
}

$options += [
'bucketName' => self::DEFAULT_BUCKET_NAME,
'chunkSizeBytes' => self::DEFAULT_CHUNK_SIZE_BYTES,
Expand Down
1 change: 1 addition & 0 deletions src/GridFS/WritableStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use function sprintf;
use function strlen;
use function substr;
use function trigger_deprecation;

Check failure on line 39 in src/GridFS/WritableStream.php

View workflow job for this annotation

GitHub Actions / phpcs

Type trigger_deprecation is not used in this file.

/**
* WritableStream abstracts the process of writing a GridFS file.
Expand Down

0 comments on commit c2ac9b5

Please sign in to comment.