namespace BookStack\Theming;
use BookStack\Auth\Access\SocialAuthService;
+use Illuminate\Contracts\Console\Kernel;
use Symfony\Component\Console\Command\Command;
class ThemeService
{
protected $listeners = [];
- /**
- * @var Command[]
- */
- protected $commands = [];
-
/**
* Listen to a given custom theme event,
* setting up the action to be ran when the event occurs.
*/
public function registerCommand(Command $command)
{
- $this->commands[] = $command;
- }
-
- /**
- * Get the custom commands that have been registered.
- */
- public function getRegisteredCommands(): array
- {
- return $this->commands;
+ /** @var \Illuminate\Foundation\Console\Kernel $consoleKernel */
+ $consoleKernel = app()->make(Kernel::class);
+ $consoleKernel->registerCommand($command);
}
/**