From 8b1e63abcc167032512a5d1810cb9943b0e7a821 Mon Sep 17 00:00:00 2001 From: Ying Date: Wed, 26 Apr 2023 15:19:26 +0800 Subject: [PATCH] =?UTF-8?q?pref:=20=E4=BC=98=E5=8C=96get=5Fenv=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- support/helpers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/support/helpers.php b/support/helpers.php index 3c47c5f..a2708d5 100644 --- a/support/helpers.php +++ b/support/helpers.php @@ -137,8 +137,8 @@ if (!function_exists('get_env')) { { $dir = str_replace('\\', '/', realpath(__DIR__ . '/../')); $env_path = $dir . '/.env'; - $env_info = []; - if (is_file($env_path)) { + static $env_info = []; + if (is_file($env_path) && !$env_info) { $env_info = parse_ini_file($env_path, true); } return $env_info[$var] ?? '';