Open GrahamCampbell opened 5 years ago
Not sure if this is even feasable, but it's super annoying now that a bunch of my tests are now failing because redis is not available. For context, these tests are checking that I can resolve some classes from the IOC, which in turn causes the IOC to resolve the redis connection, which now tries to connect to the db, but before, with predis, it wouldn't try to connect.
Not sure if this is even feasable
In a way that won't break code that messes with the internals of the connectors, that is.
Heya. I transfered this to the ideas repo since nothing is really broken atm. Feel free to send in a pr if you can solve this without breaking BC.
That's an interesting issue.
The way I understand phpredis does not support this feature right?
I has something regarding "lazy_connect" but that seems to be concerned with RedisArray
only => https://github.com/phpredis/phpredis/blob/develop/arrays.markdown#specifying-the-lazy_connect-parameter
Support for it in Laravel could only be done by a proxy object then I guess .. 🤷♀️
Noticed this the other day and had to rewrite a few things in a project to use RedisManager and then grab the connection, was a bit of a pain. I imagine this could be solved with not initialising the client until a command is called for and then have a callable build the client.
Description:
The laravel phpredis connector seems to connect to redis straight away, but the predis connector does not. It would be good if the phpredis one was also lazy when it comes to connecting to redis.