Skip to content

Commit

Permalink
配置pull获取调整支持获取器
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Oct 30, 2024
1 parent bf61445 commit 245181f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/think/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ public function has(string $name): bool
*/
protected function pull(string $name): array
{
$name = strtolower($name);

return $this->config[$name] ?? [];
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 245181f

Please sign in to comment.