diff --git a/library/think/App.php b/library/think/App.php index f2a199d4..0dba6fe8 100644 --- a/library/think/App.php +++ b/library/think/App.php @@ -34,7 +34,7 @@ class App // 读取扩展配置文件 if (Config::get('extra_config_list')) { foreach (Config::get('extra_config_list') as $file) { - Config::load($file, $file); + Config::load(APP_PATH . $file . EXT, $file); } } @@ -287,11 +287,11 @@ class App } else { $path = APP_PATH . $module; // 加载模块配置 - Config::load($module . 'config'); + Config::load(APP_PATH . $module . 'config' . EXT); // 加载应用状态配置 if ($config['app_status']) { - Config::load($module . $config['app_status']); + Config::load(APP_PATH . $module . $config['app_status'] . EXT); } // 加载别名文件 diff --git a/library/think/Config.php b/library/think/Config.php index 75b59514..b6a4d365 100644 --- a/library/think/Config.php +++ b/library/think/Config.php @@ -55,7 +55,6 @@ class Config public static function load($file, $name = '', $range = '') { $range = $range ?: self::$range; - $file = strpos($file, '.') ? $file : APP_PATH . $file . EXT; if (!isset(self::$config[$range])) { self::$config[$range] = []; } diff --git a/tests/thinkphp/library/think/configTest.php b/tests/thinkphp/library/think/configTest.php index 92b46788..a0167056 100644 --- a/tests/thinkphp/library/think/configTest.php +++ b/tests/thinkphp/library/think/configTest.php @@ -46,8 +46,8 @@ class configTest extends \PHPUnit_Framework_TestCase public function testLoad() { - $file = 'config'; - $config = array_change_key_case(include APP_PATH . $file . EXT); + $file = include APP_PATH . 'config' . EXT; + $config = array_change_key_case(include $file); $name = '_name_'; $range = '_test_';