mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 08:39:25 +08:00
Precursor to storing extension providers for later use
This commit is contained in:
parent
c43f4b81fd
commit
2e229c6afb
@ -5,16 +5,6 @@ use DB;
|
||||
|
||||
class ExtensionsServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap the application events.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
@ -24,11 +14,14 @@ class ExtensionsServiceProvider extends ServiceProvider
|
||||
{
|
||||
$app = $this->app;
|
||||
$extensions = json_decode(DB::table('config')->where('key', 'extensions_enabled')->pluck('value'), true);
|
||||
$providers = [];
|
||||
|
||||
foreach ($extensions as $extension) {
|
||||
if (file_exists($file = base_path().'/extensions/'.$extension.'/bootstrap.php')) {
|
||||
require $file;
|
||||
$providers[$extension] = require $file;
|
||||
}
|
||||
}
|
||||
|
||||
// @todo store $providers somewhere so that extensions can talk to each other
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user