shlink/config/autoload/redis.global.php

28 lines
692 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
use Shlinkio\Shlink\Core\Config\EnvVars;
return (static function (): array {
2022-04-23 13:44:17 +03:00
$redisServers = EnvVars::REDIS_SERVERS->loadFromEnv();
2022-07-26 11:17:50 +03:00
$pubSub = [
'redis' => [
'pub_sub_enabled' => $redisServers !== null && EnvVars::REDIS_PUB_SUB_ENABLED->loadFromEnv(false),
],
];
2022-01-01 20:40:48 +03:00
return match ($redisServers) {
2022-07-26 11:17:50 +03:00
null => $pubSub,
default => [
'cache' => [
'redis' => [
'servers' => $redisServers,
2022-04-23 13:44:17 +03:00
'sentinel_service' => EnvVars::REDIS_SENTINEL_SERVICE->loadFromEnv(),
],
],
2022-07-26 11:17:50 +03:00
...$pubSub,
],
};
})();