mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 15:42:48 +08:00
optimize:autoload增加对extend扩展目录的扫描
This commit is contained in:
@@ -30,7 +30,7 @@ class Autoload extends Command
|
|||||||
$classmapFile = <<<EOF
|
$classmapFile = <<<EOF
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* ThinkPHP 类库映射定义
|
* 类库映射
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return [
|
return [
|
||||||
@@ -42,6 +42,7 @@ EOF;
|
|||||||
'think\\' => LIB_PATH . 'think',
|
'think\\' => LIB_PATH . 'think',
|
||||||
'behavior\\' => LIB_PATH . 'behavior',
|
'behavior\\' => LIB_PATH . 'behavior',
|
||||||
'traits\\' => LIB_PATH . 'traits',
|
'traits\\' => LIB_PATH . 'traits',
|
||||||
|
'' => realpath(rtrim(EXTEND_PATH))
|
||||||
];
|
];
|
||||||
|
|
||||||
krsort($namespacesToScan);
|
krsort($namespacesToScan);
|
||||||
@@ -76,7 +77,7 @@ EOF;
|
|||||||
foreach ($this->createMap($dir, $namespace) as $class => $path) {
|
foreach ($this->createMap($dir, $namespace) as $class => $path) {
|
||||||
|
|
||||||
$pathCode = $this->getPathCode($path) . ",\n";
|
$pathCode = $this->getPathCode($path) . ",\n";
|
||||||
|
|
||||||
if (!isset($classMap[$class])) {
|
if (!isset($classMap[$class])) {
|
||||||
$classMap[$class] = $pathCode;
|
$classMap[$class] = $pathCode;
|
||||||
} elseif ($classMap[$class] !== $pathCode && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($classMap[$class] . ' ' . $path, '\\', '/'))) {
|
} 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) : "");
|
return $baseDir . (($path !== false) ? var_export($path, true) : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function normalizePath($path)
|
protected function normalizePath($path)
|
||||||
{
|
{
|
||||||
$parts = [];
|
$parts = [];
|
||||||
@@ -202,7 +202,6 @@ EOF;
|
|||||||
return $map;
|
return $map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function findClasses($path)
|
protected function findClasses($path)
|
||||||
{
|
{
|
||||||
$extraTypes = '|trait';
|
$extraTypes = '|trait';
|
||||||
|
|||||||
Reference in New Issue
Block a user