31 lines
786 B
PHP
31 lines
786 B
PHP
<?php
|
|
declare( strict_types=1 );
|
|
|
|
namespace StreamGoals\Core;
|
|
|
|
/**
|
|
* Boots feature modules. Each module exposes a static register() that adds its own hooks;
|
|
* classes that do not exist yet are skipped so modules can land independently.
|
|
*/
|
|
final class Plugin {
|
|
|
|
private const MODULES = array(
|
|
\StreamGoals\Rest\DonateController::class,
|
|
\StreamGoals\Rest\WebhookController::class,
|
|
\StreamGoals\Rest\OverlayController::class,
|
|
\StreamGoals\Admin\Admin::class,
|
|
\StreamGoals\Update\Updater::class,
|
|
);
|
|
|
|
public static function boot(): void {
|
|
Installer::maybe_upgrade();
|
|
Maintenance::register();
|
|
Privacy::register();
|
|
foreach ( self::MODULES as $module ) {
|
|
if ( class_exists( $module ) && method_exists( $module, 'register' ) ) {
|
|
$module::register();
|
|
}
|
|
}
|
|
}
|
|
}
|