mirror of
https://github.com/flarum/framework.git
synced 2025-04-28 07:34:03 +08:00

Conflicts: src/Api/Actions/Discussions/IndexAction.php src/Api/Actions/SerializeAction.php src/Core/Formatter/FormatterManager.php src/Extend/ForumAssets.php src/Forum/Actions/IndexAction.php src/Forum/ForumServiceProvider.php
33 lines
948 B
PHP
33 lines
948 B
PHP
<?php namespace Flarum\Support\Extensions;
|
|
|
|
use Flarum\Core;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class ExtensionsServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register the service provider.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
// Extensions will not be registered if Flarum is not installed yet
|
|
if (!Core::isInstalled()) {
|
|
return;
|
|
}
|
|
|
|
$extensions = json_decode(Core::config('extensions_enabled'), true);
|
|
$providers = [];
|
|
|
|
foreach ($extensions as $extension) {
|
|
if (file_exists($file = public_path().'/extensions/'.$extension.'/bootstrap.php') ||
|
|
file_exists($file = base_path().'/extensions/'.$extension.'/bootstrap.php')) {
|
|
$providers[$extension] = require $file;
|
|
}
|
|
}
|
|
|
|
// @todo store $providers somewhere (in Core?) so that extensions can talk to each other
|
|
}
|
|
}
|