From 771715fbea36542f12c49e2933c4977e0d99a9e4 Mon Sep 17 00:00:00 2001 From: Hang Jin <863448246@qq.com> Date: Fri, 28 Jul 2023 07:16:00 +0000 Subject: [PATCH 1/2] add custom command dir and namespace config support --- src/config/plugin/webman/console/app.php | 3 +++ src/webman | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/config/plugin/webman/console/app.php b/src/config/plugin/webman/console/app.php index 074e986..c1186cb 100644 --- a/src/config/plugin/webman/console/app.php +++ b/src/config/plugin/webman/console/app.php @@ -21,4 +21,7 @@ 'custom_ini' => ' memory_limit = 256M ', + + 'command_dir' => app_path('command'), + 'command_namespace' => 'app\\command' ]; diff --git a/src/webman b/src/webman index 00520d1..4ea0969 100755 --- a/src/webman +++ b/src/webman @@ -21,7 +21,8 @@ if (!in_array($argv[1] ?? '', ['start', 'restart', 'stop', 'status', 'reload', ' $cli = new Command(); $cli->setName('webman cli'); $cli->installInternalCommands(); -if (is_dir($command_path = Util::guessPath(app_path(), '/command', true))) { +if (is_dir($command_path = config('plugin.webman.console.app.command_dir'))) { + $command_namespace = config('plugin.webman.console.app.command_namespace'); $cli->installCommands($command_path); } From d23076e26139410e0e73f6f99536dac00c858bfd Mon Sep 17 00:00:00 2001 From: Hang Jin <863448246@qq.com> Date: Fri, 28 Jul 2023 07:16:42 +0000 Subject: [PATCH 2/2] fix --- src/webman | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webman b/src/webman index 4ea0969..9ab1754 100755 --- a/src/webman +++ b/src/webman @@ -23,7 +23,7 @@ $cli->setName('webman cli'); $cli->installInternalCommands(); if (is_dir($command_path = config('plugin.webman.console.app.command_dir'))) { $command_namespace = config('plugin.webman.console.app.command_namespace'); - $cli->installCommands($command_path); + $cli->installCommands($command_path, $command_namespace); } foreach (config('plugin', []) as $firm => $projects) {