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();
|
2022-12-10 03:11:25 -06:00
|
|
|
$redis = ['pub_sub_enabled' => $redisServers !== null && EnvVars::REDIS_PUB_SUB_ENABLED->loadFromEnv(false)];
|
|
|
|
$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(),
|
2023-11-23 04:22:23 -06:00
|
|
|
'decode_credentials' => (bool) EnvVars::REDIS_DECODE_CREDENTIALS->loadFromEnv(false),
|
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' => [
|
2023-10-06 02:19:55 -05:00
|
|
|
'namespace' => EnvVars::CACHE_NAMESPACE->loadFromEnv('Shlink'),
|
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
|
|
|
})();
|