mirror of
https://github.com/flarum/core.git
synced 2025-07-19 07:41:22 +02:00
Register database and cache implementations as binding for the settings repository
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php namespace Flarum\Core;
|
||||
|
||||
use Flarum\Core\Settings\CachedSettingsRepository;
|
||||
use Flarum\Core\Settings\DatabaseSettingsRepository;
|
||||
use Flarum\Core\Users\User;
|
||||
use Flarum\Support\ServiceProvider;
|
||||
use Flarum\Extend;
|
||||
@@ -31,6 +33,14 @@ class CoreServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->singleton('Flarum\Core\Settings\SettingsRepository', function() {
|
||||
return new CachedSettingsRepository(
|
||||
new DatabaseSettingsRepository(
|
||||
$this->app->make('Illuminate\Database\ConnectionInterface')
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
$this->app->singleton('flarum.forum', 'Flarum\Core\Forum');
|
||||
|
||||
// TODO: probably use Illuminate's AggregateServiceProvider
|
||||
|
Reference in New Issue
Block a user