mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
optimize:autoload增加对extend扩展目录的扫描
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user