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