Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPLIB-1325 Deprecate setting disableMD5 to false when using GridFS #1205

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Dec 15, 2023

@GromNaN GromNaN marked this pull request as draft December 15, 2023 19:28
src/GridFS/Bucket.php Outdated Show resolved Hide resolved
@GromNaN GromNaN force-pushed the PHPLIB-1325 branch 2 times, most recently from c2ac9b5 to 4980d54 Compare January 3, 2024 14:16
@GromNaN GromNaN changed the title PHPLIB-1325 Deprecate not setting disableMD5 to true when using GridFS PHPLIB-1325 Deprecate setting disableMD5 to false when using GridFS Jan 3, 2024
@GromNaN GromNaN marked this pull request as ready for review January 3, 2024 14:17
@GromNaN
Copy link
Member Author

GromNaN commented Jan 3, 2024

Updated the PR to raise a deprecation notice if user explicitly passes false.

@@ -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.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"1.10" looks incorrect here. Should it be "1.18", since that will be the version where this change is implemented?

Copy link
Member Author

@GromNaN GromNaN Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Copilot need to be smarter with package versions. And me at reviewing my own PR.

@@ -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;
Copy link
Member

@jmikola jmikola Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the first usage of trigger_deprecation() in PHPLIB? If so, I think we should add a dependency on symfony/deprecation-contracts. The function might presently only be available through some indirect dependency.

Apologies for missing this in the last review.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched back to the native @trigger_error as used in other places in the library.

@GromNaN GromNaN requested a review from alcaeus January 8, 2024 08:17
@GromNaN GromNaN merged commit ae2eafe into mongodb:master Jan 8, 2024
24 checks passed
@GromNaN GromNaN deleted the PHPLIB-1325 branch January 8, 2024 08:46
alcaeus added a commit to alcaeus/mongo-php-library that referenced this pull request Jan 15, 2024
* master:
  PHPLIB-1323 Implement `unlink` for GridFS stream wrapper (mongodb#1206)
  PHPLIB-1330: Sync tests for failCommand errorLabels reqs (mongodb#1214)
  PHPLIB-1246: Test PHP 8.3 on Evergreen (mongodb#1213)
  PHPLIB-1324 Implement `rename` for GridFS stream wrapper  (mongodb#1207)
  PHPLIB-1248 Add examples on GridFS (mongodb#1196)
  Deprecate setting GridFS disableMD5 to false explicitly (mongodb#1205)
  PHPLIB-1326: Use more permissive top-level runOnRequirements (mongodb#1210)
  PHPLIB-1206 Add bucket alises for context resolver using GridFS StreamWrapper (mongodb#1138)
  Bump actions/upload-artifact from 3 to 4 (mongodb#1208)
  PHPLIB-1275: Replace apiargs usage in docs with extracts (mongodb#1203)
  Fix title formatting in Client::removeSubscriber() docs (mongodb#1204)
  PHPLIB-1304: Pull mongohouse image from ECR repo (mongodb#1202)
  Fix evergreen failures (mongodb#1200)
  Enable workflows to run for GitHub Merge Queue (mongodb#1199)
  PHPLIB-1313 Ensure the GridFS stream is saved when the script ends (mongodb#1197)
  PHPLIB-1309 Add addSubscriber/removeSubscriber to Client class to ease configuration (mongodb#1195)
  Master is now 1.18-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants