From 4eb69edf460c285d7b709922e3e2272baafa2e02 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 9 Dec 2015 22:52:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84config=E7=B1=BB=E7=9A=84load?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/config.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/think/config.php b/library/think/config.php index b899c1c1..092d9478 100644 --- a/library/think/config.php +++ b/library/think/config.php @@ -33,6 +33,7 @@ class Config if (empty($type)) { $type = substr(strrchr($config, '.'), 1); } + $range = $range ? $range : self::$range; $class = '\\think\\config\\driver\\' . strtolower($type); self::set((new $class())->parse($config), '', $range); } @@ -40,7 +41,8 @@ class Config // 加载配置文件 public static function load($file, $name = '', $range = '') { - $file = strpos($file, '.') ? $file : APP_PATH . $file . EXT; + $range = $range ? $range : self::$range; + $file = strpos($file, '.') ? $file : APP_PATH . $file . EXT; if (!isset(self::$config[$range])) { self::$config[$range] = []; }