Skip to content

Commit 0ac835a

Browse files
committed
Enabling use of unix sockets on Redis backend.
1 parent 4700375 commit 0ac835a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/Resque.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ public static function setBackend($server, $database = 0)
3333
self::$redis = new Resque_RedisCluster($server);
3434
}
3535
else {
36-
list($host, $port) = explode(':', $server);
36+
if (strpos($server, 'unix:') === false) {
37+
list($host, $port) = explode(':', $server);
38+
}
39+
else {
40+
$host = $server;
41+
$port = null;
42+
}
3743
require_once dirname(__FILE__) . '/Resque/Redis.php';
3844
self::$redis = new Resque_Redis($host, $port);
3945
}

0 commit comments

Comments
 (0)