mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 18:12:59 +08:00
Move extension loading to boot method
This will likely have to be reverted, to make things like $this->app->extend() work reasonably well in extensions' service providers. For now, since we fetch the enabled extensions from the config, there is no other way for us to guarantee that the config is already available.
This commit is contained in:
parent
c2bf0b6b3a
commit
6b3a86dd87
|
@ -11,13 +11,23 @@ class ExtensionsServiceProvider extends ServiceProvider
|
|||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Boot the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
// Extensions will not be registered if Flarum is not installed yet
|
||||
if (!Core::isInstalled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$extensions = json_decode(Core::config('extensions_enabled'), true);
|
||||
$config = $this->app->make('Flarum\Core\Settings\SettingsRepository')->get('extensions_enabled');
|
||||
$extensions = json_decode($config, true);
|
||||
$providers = [];
|
||||
|
||||
foreach ($extensions as $extension) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user