From 929f9b2a753774d91da004c4595ecb3c4114d0a7 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Sun, 19 Jul 2020 08:40:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96commands=E5=8F=AA=E6=9C=89?= =?UTF-8?q?=E5=9C=A8Cli=E6=A8=A1=E5=BC=8F=E4=B8=8B=E6=B3=A8=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/catcher/CatchAdminService.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extend/catcher/CatchAdminService.php b/extend/catcher/CatchAdminService.php index 60db7c6..806c446 100644 --- a/extend/catcher/CatchAdminService.php +++ b/extend/catcher/CatchAdminService.php @@ -43,11 +43,13 @@ class CatchAdminService extends Service */ protected function registerCommands(): void { - $catchConsole = new CatchConsole($this->app); + if ($this->app->runningInConsole()) { + $catchConsole = new CatchConsole($this->app); - $this->app->bind('catch_console', $catchConsole); + $this->app->bind('catch_console', $catchConsole); - $this->commands($catchConsole->commands()); + $this->commands($catchConsole->commands()); + } } /** *