From df4a0242a6f5b4363250c250c24ef95908752f62 Mon Sep 17 00:00:00 2001 From: xiaomlove <353856593@qq.com> Date: Fri, 30 Apr 2021 19:16:51 +0800 Subject: [PATCH] fix: globalfunctions composer install error --- include/globalfunctions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/globalfunctions.php b/include/globalfunctions.php index 0b9cd3e6..c8ef92be 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -289,6 +289,9 @@ function nexus_env($key = null, $default = null) function readEnvFile($envFile) { if (!file_exists($envFile)) { + if (php_sapi_name() == 'cli') { + return []; + } throw new \RuntimeException("env file : $envFile is not exists in the root path."); } $env = [];