update:模块配置加载
This commit is contained in:
parent
25c5faf440
commit
5ec24ae9c9
@ -15,18 +15,11 @@ use catcher\ModuleService;
|
||||
|
||||
class MonitorService extends ModuleService
|
||||
{
|
||||
public function register()
|
||||
protected function loadConfig()
|
||||
{
|
||||
parent::register(); // TODO: Change the autogenerated stub
|
||||
|
||||
$this->registerConfig();
|
||||
return require __DIR__ . DIRECTORY_SEPARATOR . 'config.php';
|
||||
}
|
||||
|
||||
protected function registerConfig()
|
||||
{
|
||||
$this->app->config->set(array_merge($this->app->config->get('catch'),
|
||||
require __DIR__ . DIRECTORY_SEPARATOR . 'config.php'), 'catch');
|
||||
}
|
||||
public function loadRouteFrom()
|
||||
{
|
||||
// TODO: Implement loadRouteFrom() method.
|
||||
|
@ -28,7 +28,9 @@ abstract class ModuleService extends Service
|
||||
|
||||
$this->registerEvents();
|
||||
|
||||
$this->registerCommands();;
|
||||
$this->registerCommands();
|
||||
|
||||
$this->registerConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -44,6 +46,19 @@ abstract class ModuleService extends Service
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* register config
|
||||
*
|
||||
* @time 2020年09月25日
|
||||
* @return void
|
||||
*/
|
||||
protected function registerConfig()
|
||||
{
|
||||
if (method_exists($this, 'loadConfig')) {
|
||||
$this->app->config->set(array_merge($this->app->config->get('catch'), $this->loadConfig()), 'catch');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册commands
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user