From e4d8135624ffa7e2551d9f692b0538cf3c6f5c6f Mon Sep 17 00:00:00 2001 From: dongww Date: Wed, 16 Dec 2015 23:27:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=B0=E8=AF=AD=E6=B3=95?= =?UTF-8?q?=E7=AE=80=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/config.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/think/config.php b/library/think/config.php index a0472fd6..be1f84ff 100644 --- a/library/think/config.php +++ b/library/think/config.php @@ -43,14 +43,14 @@ class Config $driver = new Ini(); } - $range = $range ? $range : self::$range; + $range = $range ?: self::$range; self::set($driver->parse($config), '', $range); } // 加载配置文件 public static function load($file, $name = '', $range = '') { - $range = $range ? $range : self::$range; + $range = $range ?: self::$range; $file = strpos($file, '.') ? $file : APP_PATH . $file . EXT; if (!isset(self::$config[$range])) { self::$config[$range] = []; @@ -61,7 +61,7 @@ class Config // 检测配置是否存在 public static function has($name, $range = '') { - $range = $range ? $range : self::$range; + $range = $range ?: self::$range; $name = strtolower($name); if (!strpos($name, '.')) { @@ -76,7 +76,7 @@ class Config // 获取配置参数 为空则获取所有配置 public static function get($name = null, $range = '') { - $range = $range ? $range : self::$range; + $range = $range ?: self::$range; // 无参数时获取所有 if (empty($name) && isset(self::$config[$range])) { return self::$config[$range]; @@ -102,7 +102,7 @@ class Config // 设置配置参数 name为数组则为批量设置 public static function set($name, $value = null, $range = '') { - $range = $range ? $range : self::$range; + $range = $range ?: self::$range; if (!isset(self::$config[$range])) { self::$config[$range] = []; }