Redis options
This commit is contained in:
@ -33,15 +33,11 @@ return [
|
|||||||
'host' => $container->get('REDIS_HOST'),
|
'host' => $container->get('REDIS_HOST'),
|
||||||
'port' => $container->get('REDIS_PORT')
|
'port' => $container->get('REDIS_PORT')
|
||||||
];
|
];
|
||||||
$parameters = [];
|
|
||||||
if ($container->has('REDIS_USER')) {
|
if ($container->has('REDIS_USER')) {
|
||||||
$parameters['username'] = $container->get('REDIS_USER');
|
$options['username'] = $container->get('REDIS_USER');
|
||||||
}
|
}
|
||||||
if ($container->has('REDIS_PASSWORD')) {
|
if ($container->has('REDIS_PASSWORD')) {
|
||||||
$parameters['password'] = $container->get('REDIS_PASSWORD');
|
$options['password'] = $container->get('REDIS_PASSWORD');
|
||||||
}
|
|
||||||
if (!empty($parameters)) {
|
|
||||||
$options['parameters'] = $parameters;
|
|
||||||
}
|
}
|
||||||
return new Predis\Client($options);
|
return new Predis\Client($options);
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user