mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
Support either/both username and password for Redis #1602
This commit is contained in:
parent
2f0b6433bc
commit
20871055e4
1 changed files with 4 additions and 1 deletions
5
common/framework/drivers/cache/redis.php
vendored
5
common/framework/drivers/cache/redis.php
vendored
|
|
@ -48,7 +48,10 @@ class Redis implements \Rhymix\Framework\Drivers\CacheInterface
|
||||||
$this->_conn->connect($info['host'], $info['port'], 0.15);
|
$this->_conn->connect($info['host'], $info['port'], 0.15);
|
||||||
if(isset($info['user']) || isset($info['pass']))
|
if(isset($info['user']) || isset($info['pass']))
|
||||||
{
|
{
|
||||||
$this->_conn->auth(isset($info['user']) ? $info['user'] : $info['pass']);
|
$auth = [];
|
||||||
|
if (isset($info['user']) && $info['user']) $auth[] = $info['user'];
|
||||||
|
if (isset($info['pass']) && $info['pass']) $auth[] = $info['pass'];
|
||||||
|
$this->_conn->auth(count($auth) > 1 ? $auth : $auth[0]);
|
||||||
}
|
}
|
||||||
if(isset($info['fragment']) && $dbnum = intval($info['fragment']))
|
if(isset($info['fragment']) && $dbnum = intval($info['fragment']))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue