mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-03 18:40:52 +08:00
- Add AnyTLS protocol support - Add system logs viewing in admin panel - Refactor client subscription delivery code - Refactor hook mechanism - Add plugin support for Shadowsocks protocol - Add CSV export option for batch user creation - Fix mobile admin login page width display issue
50 lines
863 B
PHP
50 lines
863 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Support\ProtocolManager;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class ProtocolServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* 注册服务
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
$this->app->scoped('protocols.manager', function ($app) {
|
|
return new ProtocolManager($app);
|
|
});
|
|
|
|
$this->app->scoped('protocols.flags', function ($app) {
|
|
return $app->make('protocols.manager')->getAllFlags();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 启动服务
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
// 在启动时预加载协议类并缓存
|
|
$this->app->make('protocols.manager')->registerAllProtocols();
|
|
|
|
}
|
|
|
|
/**
|
|
* 提供的服务
|
|
*
|
|
* @return array
|
|
*/
|
|
public function provides()
|
|
{
|
|
return [
|
|
'protocols.manager',
|
|
'protocols.flags',
|
|
];
|
|
}
|
|
} |