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';