]> BookStack Code Mirror - bookstack/blobdiff - app/Theming/ThemeService.php
Added test for logical-theme-system command registration
[bookstack] / app / Theming / ThemeService.php
index 602abaf1c5a35e4845cbde67aec8981071271f5c..f0f8f033c4d9c4542259906835cb1bf98d4651a3 100644 (file)
@@ -3,6 +3,8 @@
 namespace BookStack\Theming;
 
 use BookStack\Auth\Access\SocialAuthService;
+use Illuminate\Contracts\Console\Kernel;
+use Symfony\Component\Console\Command\Command;
 
 class ThemeService
 {
@@ -43,6 +45,16 @@ class ThemeService
         return null;
     }
 
+    /**
+     * Register a new custom artisan command to be available.
+     */
+    public function registerCommand(Command $command)
+    {
+        /** @var \Illuminate\Foundation\Console\Kernel $consoleKernel */
+        $consoleKernel = app()->make(Kernel::class);
+        $consoleKernel->registerCommand($command);
+    }
+
     /**
      * Read any actions from the set theme path if the 'functions.php' file exists.
      */