From 245181f265b6834484ed3079ca1c0f0c79e0b5a7 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 30 Oct 2024 17:33:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AEpull=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=94=AF=E6=8C=81=E8=8E=B7=E5=8F=96=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/think/Config.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/think/Config.php b/src/think/Config.php index b229c1f1d7..e612bf92a0 100644 --- a/src/think/Config.php +++ b/src/think/Config.php @@ -115,8 +115,6 @@ public function has(string $name): bool */ protected function pull(string $name): array { - $name = strtolower($name); - return $this->config[$name] ?? []; } @@ -146,7 +144,12 @@ public function get(?string $name = null, $default = null) } if (!str_contains($name, '.')) { - return $this->pull($name); + $name = strtolower($name); + $result = $this->pull($name); + if ($this->hook) { + return $this->lazy($name, $result, []); + } + return $result; } $item = explode('.', $name);