Fix console installer not working

Some commands have dependencies which causes errors when there's no config/database access, so they shouldn't be instantiated.
This commit is contained in:
Toby Zerner 2016-04-25 09:17:11 +09:30
parent 7459afb89e
commit bdcea8e152

View File

@ -42,16 +42,21 @@ class Server extends AbstractServer
$commands = [
InstallCommand::class,
MigrateCommand::class,
InfoCommand::class,
CacheClearCommand::class,
GenerateExtensionCommand::class,
GenerateMigrationCommand::class,
];
if ($app->isInstalled()) {
$commands = array_merge($commands, [
InfoCommand::class,
CacheClearCommand::class
]);
}
foreach ($commands as $command) {
$console->add($app->make(
$command,
['config' => $app->make('flarum.config')]
['config' => $app->isInstalled() ? $app->make('flarum.config') : []]
));
}