optimize:autoload增加对extend扩展目录的扫描

This commit is contained in:
yunwuxin
2016-08-10 14:34:12 +08:00
parent 784294f846
commit 37a6494457

View File

@@ -30,7 +30,7 @@ class Autoload extends Command
$classmapFile = <<<EOF
<?php
/**
* ThinkPHP 类库映射定义
* 类库映射
*/
return [
@@ -42,6 +42,7 @@ EOF;
'think\\' => 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';