mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-09 10:22:51 +03:00
Tweaked custom command registration, Added StyleCI fixes
Old command registration method was interfering with default commands, causing only a limited subset of commands to show overall. This change follows the method the frameworks uses when loading in from a directory to prevent issues with run/load order.
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace BookStack\Theming;
|
||||
|
||||
use BookStack\Auth\Access\SocialAuthService;
|
||||
use Illuminate\Console\Application;
|
||||
use Illuminate\Console\Application as Artisan;
|
||||
use Illuminate\Contracts\Console\Kernel;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
|
||||
@@ -50,9 +52,9 @@ class ThemeService
|
||||
*/
|
||||
public function registerCommand(Command $command)
|
||||
{
|
||||
/** @var \Illuminate\Foundation\Console\Kernel $consoleKernel */
|
||||
$consoleKernel = app()->make(Kernel::class);
|
||||
$consoleKernel->registerCommand($command);
|
||||
Artisan::starting(function(Application $application) use ($command) {
|
||||
$application->addCommands([$command]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user