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

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

@@ -26,7 +26,7 @@ class Loader
include self::$map[$class];
} else {
// 命名空间自动加载
$name = strstr($class, '\\', true);
$name = strtolower(strstr($class, '\\', true));
if (isset(self::$namespace[$name])) {
// 注册的命名空间
$path = dirname(self::$namespace[$name]) . '/';
@@ -246,7 +246,7 @@ class Loader
if (class_exists($class)) {
$o = new $class();
if (!empty($method) && method_exists($o, $method)) {
$_instance[$identify] = call_user_func_array([ & $o, $method],[]);
$_instance[$identify] = call_user_func_array([ & $o, $method], []);
} else {
$_instance[$identify] = $o;
}