From 897be354e4cddb8da1b774f8df6753c60607ef3f Mon Sep 17 00:00:00 2001 From: thinkphp Date: Wed, 22 Jun 2016 15:20:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BLoader=E7=B1=BB=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8A=A0=E8=BD=BD=E7=9A=84=E6=96=87=E6=A1=A3=E5=AE=9A?= =?UTF-8?q?=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Loader.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/think/Loader.php b/library/think/Loader.php index 6149751c..330bfdc9 100644 --- a/library/think/Loader.php +++ b/library/think/Loader.php @@ -60,7 +60,7 @@ class Loader return false; } $item = explode('\\', $class); - // 解析命名空间 + // 解析命名空间所在的路径 if (count($item) > 2 && isset(self::$namespace[$item[0] . '\\' . $item[1]])) { // 子命名空间定义(仅支持二级) list($ns1, $ns2, $class) = explode('\\', $class, 3); @@ -81,16 +81,16 @@ class Loader foreach ((array) $path as $p) { $filename = $p . str_replace('\\', DS, $class) . EXT; if (is_file($filename)) { + // Win环境严格区分大小写 + if (IS_WIN && false === strpos(realpath($filename), $class . EXT)) { + continue; + } $match = true; break; } } if ($match) { - // 开启调试模式Win环境严格区分大小写 - if (IS_WIN && false === strpos(realpath($filename), $class . EXT)) { - return false; - } include $filename; } else { return false;