1
0
mirror of https://github.com/flarum/core.git synced 2025-07-21 00:31:17 +02:00

Move logic to Extension class

The gathering and execution of extenders can actually be done here
in the `Extension` class. This way, the `ExtensionManager` only
deals with the question of which extensions are enabled, the
`Extension` class actually extends the core application, and the
service provider simply calls a method, without having to know
about internals.
This commit is contained in:
Franz Liedke
2018-03-04 01:16:50 +01:00
parent 2967b5d106
commit db7cd71f19
3 changed files with 32 additions and 29 deletions

View File

@@ -24,11 +24,7 @@ class ExtensionServiceProvider extends AbstractServiceProvider
$this->app->bind('flarum.extensions', ExtensionManager::class);
$this->app->booting(function (Container $app) {
$extenders = $app->make('flarum.extensions')->getActiveExtenders();
foreach ($extenders as $extender) {
$extender($app);
}
$app->make('flarum.extensions')->extend($app);
});
}