blessing-skin-server/app/Providers/PluginServiceProvider.php

38 lines
728 B
PHP
Raw Normal View History

2016-10-17 12:20:55 +08:00
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class PluginServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
//
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
$this->app->bind('plugins', 'App\Services\PluginManager');
$bootstrappers = $this->app->make('plugins')->getEnabledBootstrappers();
foreach ($bootstrappers as $file) {
// bootstraper is a closure
$bootstrapper = require $file;
$this->app->call($bootstrapper);
}
}
}