mirror of https://github.com/bilde2910/Hauk.git
Merge pull request #140 from rickvanderzwet/fix_redis_unix_socket_connect
Fix unable to connect to redis socket
This commit is contained in:
commit
076dc9ac84
|
@ -8,8 +8,13 @@ class MemWrapper {
|
|||
|
||||
function __construct() {
|
||||
$this->redis = new Redis();
|
||||
$this->redis->connect(getConfig("redis_host"), getConfig("redis_port"))
|
||||
or die ("Server could not connect to Redis!\n");
|
||||
if(substr(getConfig("redis_host"), 0, 1) === "/") {
|
||||
$this->redis->connect(getConfig("redis_host"))
|
||||
or die ("Server could not connect to Redis socket!\n");
|
||||
} else {
|
||||
$this->redis->connect(getConfig("redis_host"), getConfig("redis_port"))
|
||||
or die ("Server could not connect to Redis!\n");
|
||||
}
|
||||
if (getConfig("redis_use_auth")) {
|
||||
$this->redis->auth(getConfig("redis_auth"))
|
||||
or die("Incorrect Redis authentication!");
|
||||
|
|
Loading…
Reference in New Issue