驱动设计支持使用 namespace配置改变默认命名空间位置

This commit is contained in:
thinkphp
2015-12-26 17:59:07 +08:00
parent bd322b82e5
commit a746982703
7 changed files with 19 additions and 11 deletions

View File

@@ -40,7 +40,7 @@ class Config
if (empty($type)) {
$type = pathinfo($config, PATHINFO_EXTENSION);
}
$class = '\\think\\config\\driver\\' . ucwords($type);
$class = (false === strpos($type, '\\')) ? '\\think\\config\\driver\\' . ucwords($type) : $type;
self::set((new $class())->parse($config), '', $range);
}