mirror of
https://github.com/flarum/framework.git
synced 2025-02-01 06:54:16 +08:00
Fix installation
This commit is contained in:
parent
c82a48bfbb
commit
d237dc84aa
|
@ -27,7 +27,7 @@ class DatabaseServiceProvider extends AbstractServiceProvider
|
||||||
$this->app->singleton('flarum.db', function () {
|
$this->app->singleton('flarum.db', function () {
|
||||||
$factory = new ConnectionFactory($this->app);
|
$factory = new ConnectionFactory($this->app);
|
||||||
|
|
||||||
$connection = $factory->make($this->app->make('flarum.config')['database']);
|
$connection = $factory->make($this->app->config('database'));
|
||||||
$connection->setEventDispatcher($this->app->make('Illuminate\Contracts\Events\Dispatcher'));
|
$connection->setEventDispatcher($this->app->make('Illuminate\Contracts\Events\Dispatcher'));
|
||||||
$connection->setFetchMode(PDO::FETCH_CLASS);
|
$connection->setFetchMode(PDO::FETCH_CLASS);
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ class InstallCommand extends AbstractCommand
|
||||||
|
|
||||||
protected function writeSettings()
|
protected function writeSettings()
|
||||||
{
|
{
|
||||||
$settings = $this->application->make('Flarum\Settings\SettingsRepository');
|
$settings = $this->application->make('Flarum\Settings\SettingsRepositoryInterface');
|
||||||
|
|
||||||
$this->info('Writing default settings');
|
$this->info('Writing default settings');
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ class LocaleServiceProvider extends AbstractServiceProvider
|
||||||
$this->app->alias('Flarum\Locale\LocaleManager', 'flarum.localeManager');
|
$this->app->alias('Flarum\Locale\LocaleManager', 'flarum.localeManager');
|
||||||
|
|
||||||
$this->app->singleton('translator', function () {
|
$this->app->singleton('translator', function () {
|
||||||
$defaultLocale = $this->app->make('flarum.settings')->get('default_locale');
|
$defaultLocale = $this->app->isInstalled() ? $this->app->make('flarum.settings')->get('default_locale') : 'en';
|
||||||
|
|
||||||
$translator = new Translator($defaultLocale, new MessageSelector());
|
$translator = new Translator($defaultLocale, new MessageSelector());
|
||||||
$translator->setFallbackLocales([$defaultLocale]);
|
$translator->setFallbackLocales([$defaultLocale]);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user