-
-
Notifications
You must be signed in to change notification settings - Fork 508
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
Deprecate using doctrine/cache for metadata caching #2253
Conversation
return $this->metadataCache; | ||
} | ||
|
||
public function setMetadataCache(CacheItemPoolInterface $cache) : void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will entail a change in the Symfony bundle and Laminas module, right? Mind opening issues there so we won't forget?
@@ -23,8 +24,7 @@ | |||
$config->setHydratorDir(__DIR__ . '/Hydrators'); | |||
$config->setHydratorNamespace('Hydrators'); | |||
$config->setDefaultDB('doctrine_odm_sandbox'); | |||
// $config->setLoggerCallable(function(array $log) { print_r($log); }); | |||
// $config->setMetadataCacheImpl(new Doctrine\Common\Cache\ApcCache()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must've been left over from 1.x since we dropped setLoggerCallable
in 2.0.
44f2e47
to
4f18e9e
Compare
doctrine/persistence will support PSR-6 caches starting with the next minor release, so this is good to go 🎉 |
4f18e9e
to
7f40223
Compare
7f40223
to
b9f2ad5
Compare
Updated now that doctrine/cache 1.11 is released. |
@@ -161,12 +168,40 @@ public function getMetadataDriverImpl(): ?MappingDriver | |||
|
|||
public function getMetadataCacheImpl(): ?Cache | |||
{ | |||
trigger_deprecation( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we switching to new way of triggering deprecations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switched over to using symfony/deprecation-contracts in #2249.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah cool, silly me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow I thought these are doctrine/deprecations calls 😅
Hey @alcaeus, any idea when this will be live ? I need in a projet doctrine/cache 2.x working with mongodb-odm. Thanks ;) |
@Skape252 we are planning to release both ODM v2.3 and bundle v4.4 later this month. |
Yeah since our development is going to last for few weeks we installed the dev version. We will give you update for any issue we found . good luck ;) |
Hey @IonBazan. Our team tested for several weeks the Any news for a release soon ? We're waiting the ODM V2.3 for a release of our feature on our side. GL 👋 |
Hello @Skape252 v2.3.0 has already been released on 1 December: https://github.com/doctrine/mongodb-odm/releases/tag/2.3.0 |
Indeed sorry for that, i checked the github roadmap instead of the release tag. Perfect ! Thanks for the work ;) |
Summary
This PR deprecates using doctrine/cache for metadata caching in favour of PSR-6. To provide a full compatibility layer, the symfony/cache package is used to provide both implementations regardless of what has been set.
This PR anticipates changes in doctrine/persistence, where doctrine/cache will also be deprecated: if a new enough version of doctrine/persistence is installed, it will revert to always using a PSR-6 cache in favour of doctrine/cache. This requires doctrine/persistence#144 to be merged first. If that PR is rejected, I'll remove the compatibility layer before merging this change.