<commit_before><?php namespace Flarum\Support\Extensions;

use Illuminate\Support\ServiceProvider;
use DB;

class ExtensionsServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application events.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $app = $this->app;
        $extensions = json_decode(DB::table('config')->where('key', 'extensions_enabled')->pluck('value'), true);

        foreach ($extensions as $extension) {
            if (file_exists($file = base_path().'/extensions/'.$extension.'/bootstrap.php')) {
                require $file;
            }
        }
    }
}<commit_msg>Precursor to storing extension providers for later use<commit_after><?php namespace Flarum\Support\Extensions;

use Illuminate\Support\ServiceProvider;
use DB;

class ExtensionsServiceProvider extends ServiceProvider
{
    /**
     * Register the service provider.
     *
     * @return void
     */
    public function register()
    {
        $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')) {
                $providers[$extension] = require $file;
            }
        }

        // @todo store $providers somewhere so that extensions can talk to each other
    }
}
{'fraction_non_alphanumeric': 0.1329153605015674, 'fraction_numerical': 0.0, 'mean_word_length': 2.41025641025641, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1883985', 'n_tokens_mistral': 430, 'n_tokens_neox': 424, 'n_words': 100}