SncRedisBundle: SncRedis doesn't work with runtime environment variables
Currently SncRedis doesn’t allow to use the new environment variables, apparently this bundle does something before the envs are setted. So you can’t use redis_dsn: "%env(REDIS_DSN)%" because you receive that literal string instead the current env value.
Info: http://symfony.com/blog/new-in-symfony-3-2-runtime-environment-variables PR: https://github.com/symfony/symfony/pull/19681
In the PR there is a comment:
magnusnordlander commented on 20 Aug This is an interesting approach, but it is not as backwards compatible as one would think. There are bundles out there today, which as a part of their extension actually manipulate parameters. SncRedisBundle e.g. splits DSNs in the extension. Passing one of these parameters there will at best cause some kind of syntax error in the bundle, or at worst cause old environment values to be cached.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 19 (3 by maintainers)
@snc are you planning to create a tag? say 2.0.2 ?
Hi there.
I’m not being able to get this working. Using SF 3.3.6 and the latest master of this bundle.
Here’s my setup:
Locally everything works fine. But in staging I have the
REDIS_HOSTenv var set with a different value, but this is not assuming it and keeps using"redis_service".I’ve even been poking around the bundle code for the last few hours trying to find the problem and get this working but with no luck.
Any help/pointers to solve this are greatly appreciated.
Thanks in advance.
PS - I doubt this is related but just in case I’m leaving the note… I’m running my symfony app inside a docker container and redis on another.
PS2 - I’ve also tried to use the approach of a single REDIS_URL paramenter (added at #353) but didn’t work either. 😞
@dkreuer Here is an extract of my files.
parameters.yml:
and config.yml: