From 37a649445720faf209faa6bd04fc279f0ec687de Mon Sep 17 00:00:00 2001 From: yunwuxin <448901948@qq.com> Date: Wed, 10 Aug 2016 14:34:12 +0800 Subject: [PATCH] =?UTF-8?q?optimize:autoload=E5=A2=9E=E5=8A=A0=E5=AF=B9ext?= =?UTF-8?q?end=E6=89=A9=E5=B1=95=E7=9B=AE=E5=BD=95=E7=9A=84=E6=89=AB?= =?UTF-8?q?=E6=8F=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/console/command/optimize/Autoload.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/library/think/console/command/optimize/Autoload.php b/library/think/console/command/optimize/Autoload.php index 1fa28a44..93820c02 100644 --- a/library/think/console/command/optimize/Autoload.php +++ b/library/think/console/command/optimize/Autoload.php @@ -30,7 +30,7 @@ class Autoload extends Command $classmapFile = << LIB_PATH . 'think', 'behavior\\' => LIB_PATH . 'behavior', 'traits\\' => LIB_PATH . 'traits', + '' => realpath(rtrim(EXTEND_PATH)) ]; krsort($namespacesToScan); @@ -76,7 +77,7 @@ EOF; foreach ($this->createMap($dir, $namespace) as $class => $path) { $pathCode = $this->getPathCode($path) . ",\n"; - + if (!isset($classMap[$class])) { $classMap[$class] = $pathCode; } elseif ($classMap[$class] !== $pathCode && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($classMap[$class] . ' ' . $path, '\\', '/'))) { @@ -114,7 +115,6 @@ EOF; return $baseDir . (($path !== false) ? var_export($path, true) : ""); } - protected function normalizePath($path) { $parts = []; @@ -202,7 +202,6 @@ EOF; return $map; } - protected function findClasses($path) { $extraTypes = '|trait';