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