allow users to use a credis native setup
... instead of testing an unused variable
this change allows us to pass a credis_cluster object as $server and thus use a preconfigured sentinel setup. and it is already tested in production
best regards.
Seeing as the current code lets you do the same exact thing by passing the object as the third argument instead of the first... Without modifications... This change is a backwards compatibility break, and doesn't actually add anything that isn't already there, so it probably won't be merged.
The only place i can locate, where Resque::$redis is assigned, seems to be here:
https://github.com/chrisboulton/php-resque/blob/968b7e6a307a2079051dfc571d2fc2be0546209f/lib/Resque.php#L62
(and maybe two lines above that).
You might notice the apparent lack of a third argument.
So yes, the current implementation of Resque_Redis does allow for a native setup, but the current implementation of Resque does not.
But i am always open for a configuration example with the current release that can use a sentinel setup.
Let me rephrase, then. If the issue is that nothing is actually passing the third argument to the Resque_Redis constructor, then the correct fix is to update the calling code to make use of this parameter, rather than negate its very existence by changing the one pair of lines that uses it.