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

Deprecate using doctrine/cache for metadata caching #2253

Merged
merged 3 commits into from
Apr 23, 2021

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Nov 27, 2020

Q A
Type improvement
BC Break no

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.

@alcaeus alcaeus added this to the 2.2.0 milestone Nov 27, 2020
@alcaeus alcaeus requested a review from malarzm November 27, 2020 14:14
@alcaeus alcaeus self-assigned this Nov 27, 2020
return $this->metadataCache;
}

public function setMetadataCache(CacheItemPoolInterface $cache) : void
Copy link
Member

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

Choose a reason for hiding this comment

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

Is this a leftover?

Copy link
Member Author

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.

@alcaeus alcaeus removed this from the 2.2.0 milestone Jan 12, 2021
Base automatically changed from master to 2.3.x February 2, 2021 21:41
@alcaeus alcaeus force-pushed the deprecate-doctrine-cache branch from 44f2e47 to 4f18e9e Compare February 15, 2021 15:25
@alcaeus alcaeus changed the title [WAIT] Deprecate using doctrine/cache for metadata caching Deprecate using doctrine/cache for metadata caching Feb 15, 2021
@alcaeus
Copy link
Member Author

alcaeus commented Feb 15, 2021

doctrine/persistence will support PSR-6 caches starting with the next minor release, so this is good to go 🎉

@alcaeus alcaeus force-pushed the deprecate-doctrine-cache branch from 4f18e9e to 7f40223 Compare February 15, 2021 15:27
@alcaeus alcaeus force-pushed the deprecate-doctrine-cache branch from 7f40223 to b9f2ad5 Compare April 22, 2021 12:04
@alcaeus alcaeus requested a review from malarzm April 22, 2021 12:04
@alcaeus alcaeus added this to the 2.3.0 milestone Apr 22, 2021
@alcaeus
Copy link
Member Author

alcaeus commented Apr 22, 2021

Updated now that doctrine/cache 1.11 is released.

@@ -161,12 +168,40 @@ public function getMetadataDriverImpl(): ?MappingDriver

public function getMetadataCacheImpl(): ?Cache
{
trigger_deprecation(
Copy link
Member

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?

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 over to using symfony/deprecation-contracts in #2249.

Copy link
Member

Choose a reason for hiding this comment

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

Ah cool, silly me

Copy link
Member

@malarzm malarzm Apr 23, 2021

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 😅

@alcaeus alcaeus merged commit 8e8df77 into doctrine:2.3.x Apr 23, 2021
@alcaeus alcaeus deleted the deprecate-doctrine-cache branch April 23, 2021 07:06
@alcaeus alcaeus modified the milestones: 2.3.0-alpha1, 2.3.0 Sep 9, 2021
@LicenceOne
Copy link

Hey @alcaeus, any idea when this will be live ?

I need in a projet doctrine/cache 2.x working with mongodb-odm.

Thanks ;)

@IonBazan
Copy link
Member

@Skape252 we are planning to release both ODM v2.3 and bundle v4.4 later this month.
Meanwhile you can help us to test the current dev version and report any issues found.

@LicenceOne
Copy link

LicenceOne commented Nov 16, 2021

@IonBazan

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 ;)

@LicenceOne
Copy link

Hey @IonBazan.

Our team tested for several weeks the dev version of this v2.3. Everything works fine 👌

Any news for a release soon ? We're waiting the ODM V2.3 for a release of our feature on our side.

GL 👋

@IonBazan
Copy link
Member

Hello @Skape252 v2.3.0 has already been released on 1 December: https://github.com/doctrine/mongodb-odm/releases/tag/2.3.0

@LicenceOne
Copy link

LicenceOne commented Dec 10, 2021

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 ;)

@malarzm malarzm mentioned this pull request Apr 14, 2022
10 tasks
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.

4 participants