2021-08-07 04:05:20 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2022-01-20 13:16:37 -06:00
|
|
|
use Shlinkio\Shlink\Core\Config\EnvVars;
|
2021-08-07 04:05:20 -05:00
|
|
|
|
|
|
|
return (static function (): array {
|
2022-04-23 05:44:17 -05:00
|
|
|
$redisServers = EnvVars::REDIS_SERVERS->loadFromEnv();
|
2024-10-13 05:24:59 -05:00
|
|
|
$redis = ['pub_sub_enabled' => $redisServers !== null && EnvVars::REDIS_PUB_SUB_ENABLED->loadFromEnv()];
|
2022-12-10 03:11:25 -06:00
|
|
|
$cacheRedisBlock = $redisServers === null ? [] : [
|
2022-07-26 03:17:50 -05:00
|
|
|
'redis' => [
|
2022-12-10 03:11:25 -06:00
|
|
|
'servers' => $redisServers,
|
|
|
|
'sentinel_service' => EnvVars::REDIS_SENTINEL_SERVICE->loadFromEnv(),
|
2022-07-26 03:17:50 -05:00
|
|
|
],
|
|
|
|
];
|
2021-08-07 04:05:20 -05:00
|
|
|
|
2022-12-10 03:11:25 -06:00
|
|
|
return [
|
|
|
|
'cache' => [
|
2024-10-13 05:24:59 -05:00
|
|
|
'namespace' => EnvVars::CACHE_NAMESPACE->loadFromEnv(),
|
2022-12-10 03:11:25 -06:00
|
|
|
...$cacheRedisBlock,
|
2021-08-07 04:05:20 -05:00
|
|
|
],
|
2022-12-10 03:11:25 -06:00
|
|
|
'redis' => $redis,
|
|
|
|
];
|
2021-08-07 04:05:20 -05:00
|
|
|
})();
|