mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-24 08:00:13 -06:00
28 lines
692 B
PHP
28 lines
692 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
|
|
|
return (static function (): array {
|
|
$redisServers = EnvVars::REDIS_SERVERS->loadFromEnv();
|
|
$pubSub = [
|
|
'redis' => [
|
|
'pub_sub_enabled' => $redisServers !== null && EnvVars::REDIS_PUB_SUB_ENABLED->loadFromEnv(false),
|
|
],
|
|
];
|
|
|
|
return match ($redisServers) {
|
|
null => $pubSub,
|
|
default => [
|
|
'cache' => [
|
|
'redis' => [
|
|
'servers' => $redisServers,
|
|
'sentinel_service' => EnvVars::REDIS_SENTINEL_SERVICE->loadFromEnv(),
|
|
],
|
|
],
|
|
...$pubSub,
|
|
],
|
|
};
|
|
})();
|