Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Cache] Add DoctrineProvider, for using PSR-6 pools in Doctrine Cache #18487

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
merged 1 commit into from
Apr 15, 2016

Conversation

nicolas-grekas
Copy link
Member

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

This would allow cache pool configuration as usual (see #17290) before injecting the resulting doctrine cache provider anywhere such an interface is required.

@ro0NL
Copy link
Contributor

ro0NL commented Apr 14, 2016

Shouldn't this be part of the Bridge\Doctrine namespace? It feels really weird to have a Doctrine cache provider (which is specific) within the core component...

@nicolas-grekas
Copy link
Member Author

Doctrine Cache is so dominating on the cache "market" that I considered supporting it as a special requirement of the Cache component.

@ro0NL
Copy link
Contributor

ro0NL commented Apr 14, 2016

I understand.

I assume another class namespace is not so much the problem.. but requiring an extra package (symfony/doctrine-bridge) is so.

What about a PR on doctrine/cache introducing a SymfonyAdapter which would have my vote :)

@nicolas-grekas
Copy link
Member Author

See DoctrineAdapter in the Adapter sub-namespace, this is what you're looking for, no need for patching doctrine

@ro0NL
Copy link
Contributor

ro0NL commented Apr 14, 2016

That one works the other way around...

It's legit to have 2 variants, depending on which system is providing cache in your application;

  • A doctrine cache provider delegating to symfony cache adapter psr cache pool (from this PR)
  • A symfony cache adapter delegating to doctrine cache provider (already there)

However, imho, I still feel symfony should provide a DoctrineAdapter and doctrine a SymfonyCache provider.

@nicolas-grekas
Copy link
Member Author

In fact, the DoctrineProdiver has nothing specific about Symfony. If Doctrine were to add something, it would be named Psr6Cache. You could open an issue/a PR there, I wish you good luck (please search their issue/PR history before doing so) :)

@ro0NL
Copy link
Contributor

ro0NL commented Apr 14, 2016

Point taken. I'm just reviewing this from a technical/architecture POV.

I kinda assumed the DoctrineProvider typechecks on Symfony/.../AdapterInterface but it isn't.. it delegates directly to the PSR interface, which can be any symfony adapter by definition.

And yes... doctrine should add a PsrCache provider which makes it indirectly compatible with any symfony cache adapter, imho offcourse ;-)

@fabpot
Copy link
Member

fabpot commented Apr 15, 2016

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 5d256dd into symfony:master Apr 15, 2016
fabpot added a commit that referenced this pull request Apr 15, 2016
… Doctrine Cache (nicolas-grekas)

This PR was merged into the 3.1-dev branch.

Discussion
----------

[Cache] Add DoctrineProvider, for using PSR-6 pools in Doctrine Cache

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This would allow cache pool configuration as usual (see #17290) before injecting the resulting doctrine cache provider anywhere such an interface is required.

Commits
-------

5d256dd [Cache] Add DoctrineProvider, for using PSR-6 pools in Doctrine Cache
@nicolas-grekas nicolas-grekas deleted the doctrine-provider branch April 15, 2016 12:40
@fabpot fabpot mentioned this pull request May 13, 2016
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.

5 participants