Fix #1602 support username/password for Redis cache

This commit is contained in:
Kijin Sung 2021-02-05 21:01:04 +09:00
parent 80b235001e
commit 2f0b6433bc
6 changed files with 22 additions and 3 deletions

View file

@ -801,7 +801,15 @@ class adminAdminController extends admin
}
else
{
$cache_servers = array($vars->object_cache_type . '://' . $vars->object_cache_host . ':' . intval($vars->object_cache_port));
if (trim($vars->object_cache_user) !== '' || trim($vars->object_cache_pass) !== '')
{
$auth = sprintf('%s:%s@', urlencode(trim($vars->object_cache_user)), urlencode(trim($vars->object_cache_pass)));
}
else
{
$auth = '';
}
$cache_servers = array($vars->object_cache_type . '://' . $auth . $vars->object_cache_host . ':' . intval($vars->object_cache_port));
}
if ($vars->object_cache_type === 'redis')