php - Symfony 3.1 PSR-6 Caching Settings

325

Config.yml:

cache:
    app: cache.adapter.doctrine
    system: cache.adapter.doctrine
    default_doctrine_provider: ~
    default_psr6_provider: ~
    default_redis_provider: "redis://localhost:6379"

Symfony 3.1 support doctrine cache, but you do not have enough documentation.

Cache Component: http://symfony.com/doc/current/components/cache.html
Supported drives: http://symfony.com/doc/current/components/cache/cache_pools.html
Symfony Integration: http://symfony.com/blog/new-in-symfony-3-1-cache-component

default_doctrine_provider: ? What do I enter as Provider

234

Answer

Solution:

You can pass todefault_doctrine_provider either a Redis connection DSN (for example "redis://127.0.0.1:6379") or ID of a service which implementsSymfony\Component\Cache\Adapter\AdapterInterface

You can have a look at already implemented adapters here

818

Answer

Solution:

The provider basically is the originaldoctrine_cache provider you configured. Let's say you use theDoctrineCacheBundle and your provider name ismy_apc_cache that means the container has the following service:

$myCache = $this->container->get('doctrine_cache.providers.my_apc_cache');

You could also define an alias, then it is even easier.

Take a look at the example at: https://symfony.com/doc/current/bundles/DoctrineCacheBundle/usage.html#service-aliases

People are also looking for solutions to the problem: Comparing two dates in different month return nothing in PHP

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.