改进实例化类 命名空间大小写的问题

This commit is contained in:
thinkphp
2015-12-10 12:11:33 +08:00
parent 829a09fc83
commit 9a2ff2f231
6 changed files with 16 additions and 15 deletions

View File

@@ -22,7 +22,7 @@ class Log
public static function init($config = [])
{
$type = isset($config['type']) ? $config['type'] : 'File';
$class = '\\think\\log\\driver\\' . strtolower($type);
$class = '\\think\\log\\driver\\' . ucwords($type);
unset($config['type']);
self::$storage = new $class($config);
}