0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2024-11-18 02:56:42 +01:00
nextcloud-docker/29/apache/config/redis.config.php
Jan Zalar 9360474bc1 Adding REDIS_DB_INDEX configuration to session locking aswell.
Changing naming convetion to match others

Signed-off-by: Jan Zalar <jan.zalar6@gmail.com>
2024-09-05 09:20:33 +02:00

21 lines
698 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_DB_INDEX') !== false) {
$CONFIG['redis']['dbindex'] = (int) getenv('REDIS_DB_INDEX');
}
}