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

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

@@ -29,7 +29,7 @@ class Cache
public static function connect($options = [])
{
$type = !empty($options['type']) ? $options['type'] : 'File';
$class = 'think\\cache\\driver\\' . strtolower($type);
$class = 'think\\cache\\driver\\' . ucwords($type);
self::$handler = new $class($options);
return self::$handler;
}