From ebd3421a5648b787d90cc36cda8cd22779cd80cd Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 2 Aug 2017 11:58:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BConfig=E7=B1=BB=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E9=A2=9D=E5=A4=96=E9=85=8D=E7=BD=AE=E7=9A=84=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Config.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/library/think/Config.php b/library/think/Config.php index 2b808434..3ba7db66 100644 --- a/library/think/Config.php +++ b/library/think/Config.php @@ -113,6 +113,13 @@ class Config // 二维数组设置和获取支持 $name = explode('.', $name, 2); $name[0] = strtolower($name[0]); + + if (!isset(self::$config[$range][$name[0]])) { + // 动态载入额外配置 + $module = Request::instance()->module(); + self::load(CONF_PATH . ($module ? $module . DS : '') . 'extra' . DS . strtolower($name[0]) . CONF_EXT); + } + return isset(self::$config[$range][$name[0]][$name[1]]) ? self::$config[$range][$name[0]][$name[1]] : null; } }