From e6667c6d20c6065bcf7a288ab9764d41a1f452d5 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 2 Jan 2016 20:20:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/loader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/loader.php b/library/think/loader.php index cc0cfa80..8715da81 100644 --- a/library/think/loader.php +++ b/library/think/loader.php @@ -36,8 +36,8 @@ class Loader include $file; } else { // 命名空间自动加载 - $name = strtolower(strstr($class, '\\', true)); - $class = substr($class, strlen($name) + 1); + list($name, $class) = explode('\\', $class, 2); + $name = strtolower($name); if (isset(self::$namespace[$name])) { // 注册的命名空间 $path = self::$namespace[$name];