mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-03 01:03:28 +09:00
Add Redis AUTH command
This commit is contained in:
parent
8c4ee529cd
commit
fcafcb9833
1 changed files with 4 additions and 0 deletions
4
classes/cache/CacheRedis.class.php
vendored
4
classes/cache/CacheRedis.class.php
vendored
|
|
@ -52,6 +52,10 @@ class CacheRedis extends CacheBase
|
||||||
$this->redis = new Redis;
|
$this->redis = new Redis;
|
||||||
$info = parse_url($url);
|
$info = parse_url($url);
|
||||||
$this->redis->connect($info['host'], $info['port'], 0.15);
|
$this->redis->connect($info['host'], $info['port'], 0.15);
|
||||||
|
if(isset($info['user']) || isset($info['pass']))
|
||||||
|
{
|
||||||
|
$this->redis->auth(isset($info['user']) ? $info['user'] : $info['pass']);
|
||||||
|
}
|
||||||
if(isset($info['path']) && $dbnum = intval(substr($info['path'], 1)))
|
if(isset($info['path']) && $dbnum = intval(substr($info['path'], 1)))
|
||||||
{
|
{
|
||||||
$this->redis->select($dbnum);
|
$this->redis->select($dbnum);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue