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支持理论缓存,但您没有足够的文档。
缓存组件:http://symfony.com/doc/current/components/cache.html
支持的驱动器:http://symfony.com/doc/current/components/cache/cache_pools.html
Symfony集成:http://symfony.com/blog/new-in-symfony-3-1-cache-component
default_doctrine_provider:?我应该输入什么作为提供者
发布于 2016-08-16 23:59:21
您可以向default_doctrine_provider传递Redis连接DSN (例如"redis://127.0.0.1:6379")或实现Symfony\Component\Cache\Adapter\AdapterInterface的服务的ID
您可以查看已经实现的适配器here
发布于 2016-09-29 17:24:10
提供程序基本上是您配置的原始doctrine_cache提供程序。假设您使用DoctrineCacheBundle,并且您的提供者名称为my_apc_cache,这意味着容器具有以下服务:
$myCache = $this->container->get('doctrine_cache.providers.my_apc_cache');你也可以定义一个别名,这样就更简单了。
查看下面的示例:https://symfony.com/doc/current/bundles/DoctrineCacheBundle/usage.html#service-aliases
https://stackoverflow.com/questions/38952124
复制相似问题