Merge pull request #298 from lauripiisang/patch-1

Add support for unprotected unix socket
This commit is contained in:
Chris Boulton 2016-10-11 12:04:47 -07:00 committed by GitHub
commit 5de9073562

View File

@ -148,6 +148,7 @@ class Resque_Redis
* - host:port
* - redis://user:pass@host:port/db?option1=val1&option2=val2
* - tcp://user:pass@host:port/db?option1=val1&option2=val2
* - unix:///path/to/redis.sock
*
* Note: the 'user' part of the DSN is not used.
*
@ -161,6 +162,16 @@ class Resque_Redis
// Use a sensible default for an empty DNS string
$dsn = 'redis://' . self::DEFAULT_HOST;
}
if(substr($dsn, 0, 7) === 'unix://') {
return array(
$dsn,
null,
false,
null,
null,
null,
);
}
$parts = parse_url($dsn);
// Check the URI scheme