forked from GithubBackups/vichan
update is_docker
This commit is contained in:
parent
38d96b80a5
commit
37fec1b82f
@ -12,7 +12,6 @@ defined('TINYBOARD') or exit;
|
|||||||
class Cache {
|
class Cache {
|
||||||
private static function buildCache(): CacheDriver {
|
private static function buildCache(): CacheDriver {
|
||||||
global $config;
|
global $config;
|
||||||
$isDocker = is_file("/.dockerenv") || is_file("/run/.containerenv");
|
|
||||||
|
|
||||||
switch ($config['cache']['enabled']) {
|
switch ($config['cache']['enabled']) {
|
||||||
case 'memcached':
|
case 'memcached':
|
||||||
@ -26,7 +25,7 @@ class Cache {
|
|||||||
$password = $config['cache']['redis'][2] ?? '';
|
$password = $config['cache']['redis'][2] ?? '';
|
||||||
$database = $config['cache']['redis'][3] ?? 1;
|
$database = $config['cache']['redis'][3] ?? 1;
|
||||||
|
|
||||||
if ($isDocker) {
|
if ($config['is_docker']) {
|
||||||
$host = getenv('VICHAN_REDIS_HOST') ?: $host;
|
$host = getenv('VICHAN_REDIS_HOST') ?: $host;
|
||||||
$port = getenv('VICHAN_REDIS_PORT') ?: $port;
|
$port = getenv('VICHAN_REDIS_PORT') ?: $port;
|
||||||
$password = getenv('VICHAN_REDIS_PASSWORD') ?: $password;
|
$password = getenv('VICHAN_REDIS_PASSWORD') ?: $password;
|
||||||
|
|||||||
@ -1859,7 +1859,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$isDocker = is_file("/.dockerenv") || is_file("/run/.containerenv");
|
$isDocker = is_file("/.dockerenv") || is_file("/run/.containerenv");
|
||||||
$config['docker'] = $isDocker;
|
$config['is_docker'] = $isDocker;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ====================
|
* ====================
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user