8000 Usage of non-existing cache provider services · Issue #8406 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Usage of non-existing cache provider services #8406

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

Closed
aik099 opened this issue Sep 18, 2017 · 2 comments
Closed

Usage of non-existing cache provider services #8406

aik099 opened this issue Sep 18, 2017 · 2 comments
Labels
actionable Clear and specific issues ready for anyone to take them. bug Cache Status: Needs Review
Milestone

Comments

@aik099
Copy link
aik099 commented Sep 18, 2017

On the https://symfony.com/doc/current/reference/configuration/framework.html page, when cache providers are listed (close to the bottom) each has associated service shown:

  • cache.doctrine
  • cache.redis

and others. I wasn't able to find a place where these services are registered and $this->get(...) is throwing non-existing service exception when attempting to get them.

Maybe cache.redis (in docs) should be replaced with cache.adapter.redis and so on.

@xabbuh xabbuh added actionable Clear and specific issues ready for anyone to take them. bug Cache labels Sep 19, 2017
@xabbuh xabbuh added this to the 3.3 milestone Oct 5, 2017
@xabbuh
Copy link
Member
xabbuh commented Oct 5, 2017

Actually, these alias are registered, but they are private (see
https://github.com/symfony/symfony/blob/3.3/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L1425-L1429). Thus, if you wanted to use them yourself, you would have to inject them instead of using the container as a service locater (or register a public alias yourself). I just wonder how useful it actually is for the end user to know these internal services names.

@nicolas-grekas What do you think?

@nicolas-grekas
Copy link
Member

The doc is inaccurate: there is no cache.redis/cache.psr6 pools.
The default_*_provider are applicable to any user defined pool only. If there are none, the setting is useless.

Here is an example:

  cache:
    default_redis_provider: redis://...
    pools:
      my_pool1: {adapter: cache.adapter.redis}
      my_pool2: {adapter: cache.adapter.redis, provider: "redis://..."} # same as previous, explicit provider

The main use case is configuring the default app storage:

  cache:
    app: cache.adapter.redis
    default_redis_provider: redis://...
    pools:
      my_pool1: ~
      my_pool2: ~

defines two pools (in addition to the generic cache.app one with separate namespace, but same redis storage.

javiereguiluz added a commit that referenced this issue Apr 9, 2019
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] Updated invalid service names

This will fix #8406

See https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L1682

Commits
-------

53e465d [Cache] Updated invalid service names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. bug Cache Status: Needs Review
Projects
None yet
Development

No branches or pull requests

4 participants
0