优化服务发现
This commit is contained in:
parent
ee04005d69
commit
f6783cb13e
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace catcher;
|
||||
|
||||
use catcher\command\install\InstallModuleServiceCommand;
|
||||
use catcher\command\install\ModuleServiceDiscoverCommand;
|
||||
use catcher\command\publish\WechatCommand;
|
||||
use catcher\command\Tools\BackupCommand;
|
||||
use catcher\command\Tools\CacheTrieCommand;
|
||||
@ -77,7 +77,7 @@ class CatchAdminService extends Service
|
||||
ExcelTaskCommand::class,
|
||||
WechatCommand::class,
|
||||
CacheTrieCommand::class,
|
||||
InstallModuleServiceCommand::class,
|
||||
ModuleServiceDiscoverCommand::class,
|
||||
]);
|
||||
}
|
||||
/**
|
||||
|
@ -16,7 +16,7 @@ use think\console\Input;
|
||||
use think\console\input\Option;
|
||||
use think\console\Output;
|
||||
|
||||
class InstallModuleServiceCommand extends Command
|
||||
class ModuleServiceDiscoverCommand extends Command
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
@ -79,13 +79,13 @@ PHP
|
||||
if ($module) {
|
||||
$moduleInfo = CatchAdmin::getModuleInfo(CatchAdmin::directory() . $module);
|
||||
if (isset($moduleInfo['services']) && !empty($moduleInfo['services'])) {
|
||||
return $moduleInfo['services'];
|
||||
return $moduleInfo['enable'] ? $moduleInfo['services'] : [];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
return CatchAdmin::getServices();
|
||||
return CatchAdmin::getEnabledService();
|
||||
}
|
||||
|
||||
/**
|
Loading…
x
Reference in New Issue
Block a user