update is_docker

This commit is contained in:
alexveebee 2025-04-22 20:23:10 +00:00
parent 38d96b80a5
commit 37fec1b82f
2 changed files with 2 additions and 3 deletions

View File

@ -12,7 +12,6 @@ defined('TINYBOARD') or exit;
class Cache {
private static function buildCache(): CacheDriver {
global $config;
$isDocker = is_file("/.dockerenv") || is_file("/run/.containerenv");
switch ($config['cache']['enabled']) {
case 'memcached':
@ -26,7 +25,7 @@ class Cache {
$password = $config['cache']['redis'][2] ?? '';
$database = $config['cache']['redis'][3] ?? 1;
if ($isDocker) {
if ($config['is_docker']) {
$host = getenv('VICHAN_REDIS_HOST') ?: $host;
$port = getenv('VICHAN_REDIS_PORT') ?: $port;
$password = getenv('VICHAN_REDIS_PASSWORD') ?: $password;

View File

@ -1859,7 +1859,7 @@
*/
$isDocker = is_file("/.dockerenv") || is_file("/run/.containerenv");
$config['docker'] = $isDocker;
$config['is_docker'] = $isDocker;
/*
* ====================