diff --git a/src/Foundation/Application.php b/src/Foundation/Application.php index 695974c04..e107723be 100644 --- a/src/Foundation/Application.php +++ b/src/Foundation/Application.php @@ -138,7 +138,7 @@ class Application extends Container implements ApplicationContract */ public function url($path = null) { - $config = $this->make('flarum.config'); + $config = $this->isInstalled() ? $this->make('flarum.config') : []; $url = array_get($config, 'url', $_SERVER['REQUEST_URI']); if (is_array($url)) { diff --git a/src/Install/Console/InstallCommand.php b/src/Install/Console/InstallCommand.php index fe644a758..26f3c3abd 100644 --- a/src/Install/Console/InstallCommand.php +++ b/src/Install/Console/InstallCommand.php @@ -231,6 +231,8 @@ class InstallCommand extends AbstractCommand $this->info('Writing default settings'); + $settings->set('version', $this->application->version()); + foreach ($this->settings as $k => $v) { $settings->set($k, $v); } diff --git a/src/Install/InstallServiceProvider.php b/src/Install/InstallServiceProvider.php index 2fbd1da23..598204b6e 100644 --- a/src/Install/InstallServiceProvider.php +++ b/src/Install/InstallServiceProvider.php @@ -42,6 +42,8 @@ class InstallServiceProvider extends AbstractServiceProvider $this->app->singleton('flarum.install.routes', function () { return $this->getRoutes(); }); + + $this->loadViewsFrom(__DIR__.'/../../views/install', 'flarum.install'); } /** @@ -56,7 +58,7 @@ class InstallServiceProvider extends AbstractServiceProvider $routes->get( '/', 'index', - $toController('Flarum\Install\Controller\IndexAction') + $toController('Flarum\Install\Controller\IndexController') ); $routes->post(