Skip to content

[Cache] Deprecate DoctrineProvider #40908

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

Merged

Conversation

derrabus
Copy link
Member

Q A
Branch? 5.4
Bug fix? no
New feature? no
Deprecations? yes
Tickets N/A
License MIT
Doc PR TODO

The DoctrineProvider class has been reimplemented in the doctrine/cache package, so we don't have to maintain it anymore.

@derrabus
Copy link
Member Author

cc @alcaeus

@derrabus derrabus force-pushed the improvement/deprecate-doctrine-cache-provider branch 3 times, most recently from 8b209b9 to b912136 Compare April 22, 2021 10:58
Copy link
Contributor

@alcaeus alcaeus left a comment

Choose a reason for hiding this comment

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

LGTM, but we can allow cache 2.0, which will be released next week.

@@ -34,7 +34,7 @@
},
"require-dev": {
"doctrine/annotations": "^1.10.4",
"doctrine/cache": "~1.0",
"doctrine/cache": "^1.11",
Copy link
Contributor

Choose a reason for hiding this comment

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

This can also allow 2.0 as long as you're not using an actual implementation:

Suggested change
"doctrine/cache": "^1.11",
"doctrine/cache": "^1.11|^2.0",

@@ -41,10 +41,11 @@
"symfony/property-info": "^5.3",
"symfony/translation": "^4.4|^5.0",
"doctrine/annotations": "^1.10.4",
"doctrine/cache": "~1.0",
"doctrine/cache": "^1.11",
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above with 2.0

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 needs more changes in the Validator component. Under certain circumstances, we still use an array cache from Doctrine. I'll do this in a follow-up.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good, thank you!

@derrabus derrabus force-pushed the improvement/deprecate-doctrine-cache-provider branch from b912136 to c4c35d0 Compare April 22, 2021 12:46
@derrabus derrabus force-pushed the improvement/deprecate-doctrine-cache-provider branch from c4c35d0 to 5fb1867 Compare April 22, 2021 12:51
Copy link
Member

@nicolas-grekas nicolas-grekas 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 also 👍 to add ^2.0, either in this PR or in a follow up one.

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

Would it be simpler if we also updated doctrine/annotations at the same time?

@@ -59,7 +59,7 @@ protected function doWarmUp(string $cacheDir, ArrayAdapter $arrayAdapter)
// doctrine/annotations:1.13 and above
$reader = new PsrCachedReader($this->annotationReader, $arrayAdapter, $this->debug);
} else {
$reader = new CachedReader($this->annotationReader, new DoctrineProvider($arrayAdapter), $this->debug);
$reader = new CachedReader($this->annotationReader, DoctrineProvider::wrap($arrayAdapter), $this->debug);
Copy link
Member

Choose a reason for hiding this comment

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

This line can be removed, right? It is dead code if we also update to doctrine/annotations:1.13.

Copy link
Member Author

Choose a reason for hiding this comment

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

As soon as we have a stable release of doctrine/annotations 1.13, yes.

Copy link
Contributor

Choose a reason for hiding this comment

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

doctrine/annotations 1.13 is not released yet and is not sure to be released before the next 5.x release.

Copy link
Member

Choose a reason for hiding this comment

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

oops sorry. I read the wrong version on packagist. I though it was released already.

Copy link
Contributor

Choose a reason for hiding this comment

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

No worries. I also misread and it looks like this is scheduled for 5.4 anyways, so we can definitely make that change.

@derrabus derrabus force-pushed the improvement/deprecate-doctrine-cache-provider branch from 5fb1867 to 262ac66 Compare May 14, 2021 22:41
@derrabus
Copy link
Member Author

I'll update the PR as soon as #41230 is merged and has bubbled up to 5.x.

@derrabus derrabus force-pushed the improvement/deprecate-doctrine-cache-provider branch from 262ac66 to 0d0b932 Compare May 17, 2021 20:17
@fabpot fabpot force-pushed the improvement/deprecate-doctrine-cache-provider branch from 0d0b932 to 16fccfa Compare July 4, 2021 12:17
@fabpot
Copy link
Member

fabpot commented Jul 4, 2021

Thank you @derrabus.

@fabpot fabpot merged commit 5010ebd into symfony:5.4 Jul 4, 2021
chalasr added a commit that referenced this pull request Jul 4, 2021
This PR was merged into the 6.0 branch.

Discussion
----------

[Cache] Remove DoctrineProvider

| Q             | A
| ------------- | ---
| Branch?       | 6.0
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | #40908
| License       | MIT
| Doc PR        | N/A

Commits
-------

b71101f [Cache] Remove DoctrineProvider
@derrabus derrabus deleted the improvement/deprecate-doctrine-cache-provider branch July 26, 2021 18:40
This was referenced Nov 5, 2021
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.

7 participants