mirror of
https://github.com/nextcloud/docker.git
synced 2025-02-10 21:18:27 +01:00
Addresses #1785 (which arises when using UNIX sockets) Without this fix (or manually specifying a bogus REDIS_HOST_PORT) UNIX socket connections won't work if REDIS_HOST is used to specify the socket to the container. Signed-off-by: Josh R. <josh.t.richards@gmail.com>
19 lines
564 B
PHP
19 lines
564 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' => (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;
|
|
} elseif (getenv('REDIS_HOST')[0] == '/') {
|
|
$CONFIG['redis']['port'] = 0;
|
|
}
|
|
}
|