SNC / redis的束得到控制REDIST集群 - symfony的3+

问题描述 投票:-1回答:1

我使用 “SNC / redis的束”: “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服务?

symfony
1个回答
0
投票

停止直接使用容器和使用依赖注入代替。

https://symfony.com/doc/3.4/service_container/3.3-di-changes.html

© www.soinside.com 2019 - 2024. All rights reserved.