Skip to content

Commit 5de9073

Browse files
authored
Merge pull request #298 from lauripiisang/patch-1
Add support for unprotected unix socket
2 parents d341f11 + da9d780 commit 5de9073

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/Resque/Redis.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ public function __construct($server, $database = null)
148148
* - host:port
149149
* - redis://user:pass@host:port/db?option1=val1&option2=val2
150150
* - tcp://user:pass@host:port/db?option1=val1&option2=val2
151+
* - unix:///path/to/redis.sock
151152
*
152153
* Note: the 'user' part of the DSN is not used.
153154
*
@@ -161,6 +162,16 @@ public static function parseDsn($dsn)
161162
// Use a sensible default for an empty DNS string
162163
$dsn = 'redis://' . self::DEFAULT_HOST;
163164
}
165+
if(substr($dsn, 0, 7) === 'unix://') {
166+
return array(
167+
$dsn,
168+
null,
169+
false,
170+
null,
171+
null,
172+
null,
173+
);
174+
}
164175
$parts = parse_url($dsn);
165176

166177
// Check the URI scheme

0 commit comments

Comments
 (0)