Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Cache] Fixed password used to make the redis connection.#20026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedSep 22, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Redis doesn't have user:password concepts, it only has a single "secret" one, seehttp://redis.io/commands/AUTH . What if this secret contains a ":"? What are you fixing that doesn't work today? |
ErikSaunier commentedSep 23, 2016
I'm using Heroku and there Redis add on. The url provided in the connection settings looks like this : As Heroku provide such url it would be nice to support it or report a tricks in the Symfony documentation. As an exemple, a trick already exist insnc/SncRedisBundle RedisDsn.php for this case. |
| $params =preg_replace_callback('#^redis://(?:([^@]*)@)?#',function ($m)use (&$auth) { | ||
| if (isset($m[1])) { | ||
| $auth =$m[1]; | ||
| $auth =preg_replace('/^(\w+:)?(\w+)$/','$2',$m[1]); |
nicolas-grekasSep 23, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
instead of calling preg_replace in preg_replace_callback, I propose to change the previous regexp for:'#^redis://(?:(?:[^:@]*+:)?([^@]*+)@)?#'
it should do the same, can you confirm?
nicolas-grekas commentedSep 23, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
OK, understood. There is a small potential for bc break if one uses a secret with a |
ErikSaunier commentedSep 23, 2016 • edited by nicolas-grekas
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by nicolas-grekas
Uh oh!
There was an error while loading.Please reload this page.
Thank you@nicolas-grekas , it works with |
nicolas-grekas commentedSep 23, 2016
👍 |
jakzal commentedSep 23, 2016
👍 |
fabpot commentedSep 23, 2016
Thank you@ErikSaunier. |
…(ErikSaunier)This PR was merged into the 3.1 branch.Discussion----------[Cache] Fixed password used to make the redis connection.| Q | A| ------------- | ---| Branch? | 3.1| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#20025| License | MIT| Doc PR |http://symfony.com/blog/new-in-symfony-3-1-cache-componentI do not know if it's possible to provide a test as `REDIS_HOST` is provided by Travis in [RedisAdapterTest.php](https://github.com/symfony/symfony/blob/3.1/src/Symfony/Component/Cache/Tests/Adapter/RedisAdapterTest.php).Commits-------77eea43 [Cache] Fix password used to make the redis connection.
Uh oh!
There was an error while loading.Please reload this page.
I do not know if it's possible to provide a test as
REDIS_HOSTis provided by Travis inRedisAdapterTest.php.