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

Avoid using deprecated methods #280

Merged
merged 2 commits into from
Oct 15, 2023

Conversation

rieschl
Copy link
Contributor

@rieschl rieschl commented Sep 12, 2023

MongoDB ODM 2.2 deprecated Doctrine\ODM\MongoDB\Configuration::getMetadataCacheImpl() and Doctrine\ODM\MongoDB\Configuration::setMetadataCacheImpl() in favor of Configuration::getMetadataCache and Configuration::setMetadataCache(), respectively, which use a PSR-6 compliant cache instead of doctrine/cache.

I refrained from allowing to pass a PSR-6 CacheItemPoolInterface directly for now, because it's currently unlikely that a cache pulled from doctrine.cache.[name] service key will return a PSR-6 cache. Such a change would probably also require changes in doctrine-module and doctrine-orm-module.
But if you want me to implement that forward compatibility layer right away it's also ok for me.

fixes #279

@rieschl
Copy link
Contributor Author

rieschl commented Oct 1, 2023

@driehle any feedback? Thanks 🙂

@driehle
Copy link
Member

driehle commented Oct 2, 2023

Try pulling doctrinemodule.cache.[name] instead. DoctrineModule v6 already has a compatibility layer using laminas-cache instances and doctrine.cache.[name] just a wrapper around that for doctrine/cache backward compatibility.

As I am writing this, I remember that there was some issue with the new method signatures of Doctrine's core classes. Could it be that CacheItemPoolInterface is not provided by the Laminas package?

MongoDB ODM 2.2 deprecated `Doctrine\ODM\MongoDB\Configuration::getMetadataCacheImpl()` and `Doctrine\ODM\MongoDB\Configuration::setMetadataCacheImpl()` in favor of Configuration::getMetadataCache and `Configuration::setMetadataCache()`, respectively which use a PSR-6 compliant cache instead of doctrine/cache.

I refrained from allowing to pass a PSR-6 `CacheItemPoolInterface` directly for now, because it's currently unlikely that a cache pulled from `doctrine.cache.[name]` service key will return a PSR-6 cache. Such a change would probably also require changes in doctrine-module and doctrine-orm-module.
If you want me to implement that forward compatibility layer right away it's also ok for me.

Signed-off-by: Thomas Rieschl <thomas@trinet.at>
Signed-off-by: Thomas Rieschl <thomas@trinet.at>
@rieschl rieschl requested a review from driehle October 10, 2023 12:31
@driehle driehle added the Enhancement New feature or request label Oct 15, 2023
@driehle driehle self-assigned this Oct 15, 2023
@driehle driehle added this to the 5.0.1 milestone Oct 15, 2023
@driehle driehle merged commit 82493b8 into doctrine:5.0.x Oct 15, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants