Skip to content

Commit

Permalink
Update Service.php
Browse files Browse the repository at this point in the history
  • Loading branch information
funadmin authored Jun 8, 2022
1 parent 6b818a7 commit 195498b
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/addons/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ private function loadApp()
if (in_array($childname, ['.', '..', 'public', 'view'])) {
continue;
}

if (in_array($childname, ['vendor'])) {
$autoload_file = $this->addons_path . $name . DS . $childname.DS.'autoload.php';
if (file_exists($autoload_file)){
Expand All @@ -251,11 +252,26 @@ private function loadApp()
if (in_array($mdir, ['.', '..'])) {
continue;
}
//加载配置
$commands = [];
//配置文件
$addons_config_dir = $this->addons_path . $name . DS . $childname . DS . 'config' . DS;
if (is_dir($addons_config_dir)) {
$files = glob($addons_config_dir . '*.php');
$addon_config_dir = $this->addons_path . $name . DS . 'config' . DS;
if (is_dir($addon_config_dir)) {
$files = glob($addon_config_dir . '*.php');
foreach ($files as $file) {
if (file_exists($file)) {
if (substr($file, -11) == 'console.php') {
$commands_config = include_once $file;
isset($commands_config['commands']) && $commands = array_merge($commands, $commands_config['commands']);
!empty($commands) && $this->commands($commands);
}
}
}
}
//配置文件
$module_config_dir = $this->addons_path . $name . DS . $childname . DS . 'config' . DS;
if (is_dir($module_config_dir)) {
$files = glob($module_config_dir . '*.php');
foreach ($files as $file) {
if (file_exists($file)) {
if (substr($file, -11) == 'console.php') {
Expand Down

0 comments on commit 195498b

Please sign in to comment.