Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

How to override namespace argument in RedisAdapter for a Symfony4 app to cache

$
0
0

I want to use custom namespace in our RedisAdapter to cache in our Symfony4 app. However, when i want to set arguments like this in our services.yaml;

cache.adapter.redis:        class: Symfony\Component\Cache\Adapter\RedisAdapter        arguments:            - '@Redis'            - 'app'

I see this error message:

Symfony\Component\Cache\Traits\RedisTrait::init() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, string given.

By the way, our cache config(config/packages/cache.yaml) is simple like below. So, how can I set namespace directly from any config?

    cache:        app: cache.adapter.redis        default_redis_provider: 'redis://%env(REDIS_HOST)%:%env(REDIS_PORT)%'

Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>