mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2026-06-12 22:28:15 +08:00
fix: 修复目录扫找工具
This commit is contained in:
parent
5f1fa7ea16
commit
641edc563b
@ -119,7 +119,7 @@ class NodeService extends Service
|
|||||||
$ignoreMethods = get_class_methods('\think\admin\Controller');
|
$ignoreMethods = get_class_methods('\think\admin\Controller');
|
||||||
$ignoreAppNames = Library::$sapp->config->get('app.rbac_ignore', []);
|
$ignoreAppNames = Library::$sapp->config->get('app.rbac_ignore', []);
|
||||||
// 扫描所有代码控制器节点,更新节点缓存
|
// 扫描所有代码控制器节点,更新节点缓存
|
||||||
foreach (ToolsExtend::scanDirectory(Library::$sapp->getBasePath(), 'php') as $name) {
|
foreach (ToolsExtend::scanDirectory(Library::$sapp->getBasePath(), null, 'php') as $name) {
|
||||||
if (preg_match("|^(\w+)/controller/(.+)\.php$|i", strtr($name, '\\', '/'), $matches)) {
|
if (preg_match("|^(\w+)/controller/(.+)\.php$|i", strtr($name, '\\', '/'), $matches)) {
|
||||||
[, $appName, $className] = $matches;
|
[, $appName, $className] = $matches;
|
||||||
if (in_array($appName, $ignoreAppNames)) continue;
|
if (in_array($appName, $ignoreAppNames)) continue;
|
||||||
@ -130,7 +130,7 @@ class NodeService extends Service
|
|||||||
foreach (Plugin::get() as $appName => $plugin) {
|
foreach (Plugin::get() as $appName => $plugin) {
|
||||||
if (in_array($appName, $ignoreAppNames)) continue;
|
if (in_array($appName, $ignoreAppNames)) continue;
|
||||||
[$appPath, $appSpace] = [$plugin['path'], $plugin['space']];
|
[$appPath, $appSpace] = [$plugin['path'], $plugin['space']];
|
||||||
foreach (ToolsExtend::scanDirectory($appPath, 'php') as $name) {
|
foreach (ToolsExtend::scanDirectory($appPath, null, 'php') as $name) {
|
||||||
if (preg_match("|^.*?controller/(.+)\.php$|i", strtr($name, '\\', '/'), $matches)) {
|
if (preg_match("|^.*?controller/(.+)\.php$|i", strtr($name, '\\', '/'), $matches)) {
|
||||||
static::_parseClass($appName, $appSpace, $matches[1], $ignoreMethods, $data);
|
static::_parseClass($appName, $appSpace, $matches[1], $ignoreMethods, $data);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user