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 { 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;

View File

@ -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;
/* /*
* ==================== * ====================