Skip to content

Conversation

@GromNaN
Copy link
Member

@GromNaN GromNaN commented Nov 14, 2025

Q A
Type improvement
BC Break yes
Fixed issues

Summary

doctrine/cache is deprecated and archived.

Motivation for introducing a breaking change:

  • When installing doctrine/mongodb-odm with composer, you get a message even if doctrine/cache is not actively used.

Package doctrine/cache is abandoned, you should avoid using it. No replacement was suggested.

  • The next major version will require PHP 8.4.

This is a breaking change only when calling Configuration::getMetadataCacheImpl(). The workaround is easy: add doctrine/cache as project dependency.

I consider projects that use doctrine/cache directly without explicitly requiring the package to be in error.

That's why I'm adding a conflict with doctrine/mongodb-odm-bundle < 5, which did not have an explicit dependency but used the Doctrine\Common\Cache classes:
https://github.com/doctrine/DoctrineMongoDBBundle/blob/48c29009c24ff74c47782c0c9c2736f1f5fd9b0e/DependencyInjection/DoctrineMongoDBExtension.php#L14-L15

@GromNaN GromNaN added this to the 2.16.0 milestone Nov 14, 2025
@GromNaN GromNaN changed the title Stronger deprecation of doctrine/cache Move doctrine/cache to optional dependencies Nov 14, 2025
@GromNaN GromNaN changed the title Move doctrine/cache to optional dependencies [BC break] Move doctrine/cache to optional dependencies Nov 14, 2025
Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

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

The quick fix and the proper fix should probably be mentioned in an upgrade guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants