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

Support GridFS adapter #162

Merged
merged 1 commit into from
May 30, 2024
Merged

Support GridFS adapter #162

merged 1 commit into from
May 30, 2024

Conversation

GromNaN
Copy link
Contributor

@GromNaN GromNaN commented May 24, 2024

The GridFS adapter have been reintroduced in flysystem v3.28.

This PR introduces 3 ways to configure the adapter:

  • With Doctrine MongoDB ODM Bundle, by setting the connection name
  • With a full configuration to connect to MongoDB and select a database.
  • With a custom service for MongoDB\GridFS\Bucket

I'm not fully satisfied by the integration yet, as it requires declaring many services in order to get the MongoDB\GridFS\Bucket service. I would like the setup to be more automatic when doctrine/mongodb-odm-bundle is used, as the bundle already configures the MongoDB\Client and the database to use.

Copy link
Collaborator

@maxhelias maxhelias left a comment

Choose a reason for hiding this comment

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

I'm not familiar with the mongo bundle but I see 2 options to improve the integration on this side:

Hope these options will help you

docs/2-cloud-storage-providers.md Outdated Show resolved Hide resolved
@GromNaN
Copy link
Contributor Author

GromNaN commented May 24, 2024

Thanks for the review. I used factories to create MongoDB\GridFS\Bucket instances from a doctrine connection name, or a full configuration. I'm delighted that I didn't need to use a compiler pass.

@GromNaN GromNaN force-pushed the gridfs branch 2 times, most recently from c05b3a5 to 581ee74 Compare May 24, 2024 15:13
@GromNaN GromNaN requested a review from maxhelias May 28, 2024 08:48
Copy link
Collaborator

@maxhelias maxhelias left a comment

Choose a reason for hiding this comment

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

Thanks for this integration, just 2 small comments

docs/6-gridfs.md Show resolved Hide resolved
@maxhelias
Copy link
Collaborator

@GromNaN Can you fix the CI coding style pls ?

Can be configured using a Doctrine MongoDB ODM, a MongoDB\Client configuration
or a service providing a MongoDB\GridFS\Bucket instance.
@GromNaN
Copy link
Contributor Author

GromNaN commented May 30, 2024

@GromNaN Can you fix the CI coding style pls ?

Done. And commits squashed.

@GromNaN GromNaN requested a review from maxhelias May 30, 2024 19:59
@maxhelias
Copy link
Collaborator

Thanks @GromNaN !

@maxhelias maxhelias merged commit 4fff744 into thephpleague:3.x May 30, 2024
19 checks passed
@GromNaN GromNaN deleted the gridfs branch May 30, 2024 20:28
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