我使用“ snc / redis-bundle”:“ 3.0.0-RC1”,
我将symfony 2.8更新为3.4
在控制器中,我有
$redis_cluster = $this->container->get('snc_redis.cluster');
$cached = $redis_cluster->get($resOneCacheName)
获取
The "snc_redis.cluster" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.
我如何获得Redis服务?
答案 0 :(得分:0)
停止直接使用容器,而改为使用依赖项注入。
请参见https://symfony.com/doc/3.4/service_container/3.3-di-changes.html