diff --git a/classes/class_cache_redis.php b/classes/class_cache_redis.php index c730d44b..2d0dc261 100644 --- a/classes/class_cache_redis.php +++ b/classes/class_cache_redis.php @@ -40,7 +40,7 @@ class class_cache_redis { if (isset($config['timeout']) && is_numeric($config['timeout'])) { $params[] = $config['timeout']; } - if (nexus()->isFpmMode()) { + if (is_fpm_mode()) { try { $connectResult = $redis->pconnect(...$params); } catch (\Exception $e) { diff --git a/include/core.php b/include/core.php index ff137ba9..381e69c2 100644 --- a/include/core.php +++ b/include/core.php @@ -6,7 +6,7 @@ require_once $rootpath . 'vendor/autoload.php'; $USERUPDATESET = array(); $query_name=array(); \Nexus\Nexus::boot(); -if (nexus()->isFpmMode()) { +if (is_fpm_mode()) { if (!file_exists($rootpath . '.env') || (getenv('RUNNING_IN_DOCKER') && !file_exists($rootpath . \Nexus\Install\Install::INSTALL_LOCK_FILE)) ) { diff --git a/include/globalfunctions.php b/include/globalfunctions.php index b0ef8865..1762d7d5 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -1671,3 +1671,8 @@ JS; \Nexus\Nexus::js("js/crypto-js.js", 'footer', true); \Nexus\Nexus::js($js, 'footer', false); } + +function is_fpm_mode(): bool +{ + return php_sapi_name() === 'fpm-fcgi'; +} diff --git a/nexus/Nexus.php b/nexus/Nexus.php index 4a01ce41..281b5892 100644 --- a/nexus/Nexus.php +++ b/nexus/Nexus.php @@ -176,11 +176,6 @@ final class Nexus return false; } - public function isFpmMode(): bool - { - return php_sapi_name() === 'fpm-fcgi'; - } - private function generateRequestId(): string { $prefix = ($_SERVER['SCRIPT_FILENAME'] ?? '') . implode('', $_SERVER['argv'] ?? []);