diff --git a/lib/Resque/Redis.php b/lib/Resque/Redis.php index e588dede..28051275 100644 --- a/lib/Resque/Redis.php +++ b/lib/Resque/Redis.php @@ -148,6 +148,7 @@ public function __construct($server, $database = null) * - 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 @@ public static function parseDsn($dsn) // Use a sensible default for an empty DNS string $dsn = 'redis://' . self::DEFAULT_HOST; } + if(substr($dsn, 0, 7) === 'unix://') { + return array( + $dsn, + null, + null, + null, + null, + null, + ); + } $parts = parse_url($dsn); // Check the URI scheme