mirror of
https://github.com/flarum/framework.git
synced 2025-02-22 07:48:57 +08:00
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:
parent
7459afb89e
commit
bdcea8e152
@ -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') : []]
|
||||
));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user