mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-08 09:26:42 +00:00
794671ef32
Following Laravel guidance and GitHub diff. Not yet in tested state with app-specific changes made.
31 lines
737 B
PHP
31 lines
737 B
PHP
<?php
|
|
|
|
namespace BookStack\App\Providers;
|
|
|
|
use BookStack\Theming\ThemeEvents;
|
|
use BookStack\Theming\ThemeService;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class ThemeServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
// Register the ThemeService as a singleton
|
|
$this->app->singleton(ThemeService::class, fn ($app) => new ThemeService());
|
|
}
|
|
|
|
/**
|
|
* Bootstrap services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
// Boot up the theme system
|
|
$themeService = $this->app->make(ThemeService::class);
|
|
$themeService->readThemeActions();
|
|
$themeService->dispatch(ThemeEvents::APP_BOOT, $this->app);
|
|
}
|
|
}
|