Fixed hyperf components are not scaned.

This commit is contained in:
李铭昕 2020-04-15 15:07:42 +08:00
parent 22c9a0f417
commit 46da63979c
2 changed files with 6 additions and 6 deletions

View File

@ -32,7 +32,7 @@ class ClassLoader
$paths = array_merge([
// @TODO 优化 app 路径为可配置的
BASE_PATH . '/app',
], $consfigs['annotations']['scan']['paths'] ?? []);
], $configs['annotations']['scan']['paths'] ?? []);
$classes = $scanner->scan($paths);
$this->proxies = ProxyManager::init($classes);
var_dump($this->proxies);
@ -96,4 +96,4 @@ class ClassLoader
return $this->composerLoader;
}
}
}

View File

@ -30,9 +30,9 @@ class Scanner
public function __construct(\Hyperf\Autoload\ClassLoader $classloader, array $ignoreAnnotations = [])
{
$this->classloader = $classloader;
AnnotationRegistry::registerLoader(function ($class) {
return class_exists($class, false);
});
// AnnotationRegistry::registerLoader(function ($class) {
// return class_exists($class, false);
// });
foreach ($ignoreAnnotations as $annotation) {
AnnotationReader::addGlobalIgnoredName($annotation);
@ -112,4 +112,4 @@ class Scanner
return $result;
}
}
}