Skip to content

Commit

Permalink
predis client
Browse files Browse the repository at this point in the history
  • Loading branch information
nticaric committed Jul 18, 2023
1 parent a3d4375 commit ce23b70
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"php": "~7.1|^8",
"ext-pdo_sqlite": "*",
"ext-sqlite3": "*",
"ext-mbstring": "*"
"ext-mbstring": "*",
"predis/predis": "^2.2"
},
"require-dev": {
"phpunit/phpunit": "7.*|8.*|9.*",
Expand All @@ -39,4 +40,4 @@
"helper/helpers.php"
]
}
}
}
17 changes: 13 additions & 4 deletions src/Engines/RedisEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,20 @@ public function loadConfig(array $config)
throw new Exception('Redis host and port are not set in the configuration.');
}

$redisHost = $this->config['redis_host'];
$redisPort = $this->config['redis_port'];
$redisHost = $this->config['redis_host'];
$redisPort = $this->config['redis_port'];
$redisScheme = $this->config['redis_scheme'] ?? "tcp";
$redisPassword = $this->config['redis_password'] ?? null;
$redisSSLOptions = $this->config['redis_ssl_options'] ?? null;

$this->redis = new \Predis\Client([
'scheme' => $redisScheme,
'host' => $redisHost,
'port' => $redisPort,
'password' => $redisPassword,
'ssl' => $redisSSLOptions
]);

$this->redis = new Redis();
$this->redis->connect($redisHost, $redisPort);
}

public function createIndex($indexName)
Expand Down

0 comments on commit ce23b70

Please sign in to comment.