0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2024-09-30 08:22:37 +02:00
nextcloud-docker/29/apache/config/redis.config.php
janz 374495c565 Adding support for configuring redis dbindex value
Signed-off-by: Jan Zalar jan.zalar6@gmail.com

Signed-off-by: janz <jan.zalar@arnes.si>
2024-09-02 12:04:31 +02:00

21 lines
696 B
PHP

<?php
if (getenv('REDIS_HOST')) {
$CONFIG = array(
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
'host' => getenv('REDIS_HOST'),
'password' => getenv('REDIS_HOST_PASSWORD_FILE') ? trim(file_get_contents(getenv('REDIS_HOST_PASSWORD_FILE'))) : (string) getenv('REDIS_HOST_PASSWORD'),
),
);
if (getenv('REDIS_HOST_PORT') !== false) {
$CONFIG['redis']['port'] = (int) getenv('REDIS_HOST_PORT');
} elseif (getenv('REDIS_HOST')[0] != '/') {
$CONFIG['redis']['port'] = 6379;
}
if (getenv('REDIS_DBINDEX') !== false) {
$CONFIG['redis']['dbindex'] = (int) getenv('REDIS_DBINDEX');
}
}