From 16fdc931eaab161d7c27d616913fb769a4083a28 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 30 Jul 2016 10:13:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BConfig=E7=B1=BB=E7=9A=84parse?= =?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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/think/Config.php b/library/think/Config.php index 105920b1..7256e0ed 100644 --- a/library/think/Config.php +++ b/library/think/Config.php @@ -33,6 +33,7 @@ class Config * @param string $type 配置解析类型 * @param string $name 配置名(如设置即表示二级配置) * @param string $range 作用域 + * @return mixed */ public static function parse($config, $type = '', $name = '', $range = '') { @@ -41,7 +42,7 @@ class Config $type = pathinfo($config, PATHINFO_EXTENSION); } $class = false !== strpos($type, '\\') ? $type : '\\think\\config\\driver\\' . ucwords($type); - self::set((new $class())->parse($config), $name, $range); + return self::set((new $class())->parse($config), $name, $range); } /** @@ -122,7 +123,7 @@ class Config } else { // 二维数组设置和获取支持 $name = explode('.', $name); - $result = getenv(ENV_PREFIX . strtoupper($name[0] . '_' . $name[1])); + $result = getenv(ENV_PREFIX . strtoupper($name[0] . '_' . $name[1])); // 判断环境变量 if (false !== $result) { return $result;