1
0
mirror of https://github.com/flarum/core.git synced 2025-10-11 23:14:29 +02:00

Add configuration file installation method.

This commit is contained in:
opi
2016-01-06 12:07:46 +01:00
parent 5bbcba6332
commit e3c7f5379b
2 changed files with 81 additions and 0 deletions

View File

@@ -66,6 +66,12 @@ class InstallCommand extends AbstractCommand
'd',
InputOption::VALUE_NONE,
'Create default settings and user'
)
->addOption(
'file',
'f',
InputOption::VALUE_REQUIRED,
'Use external configuration file'
);
}
@@ -99,6 +105,8 @@ class InstallCommand extends AbstractCommand
if ($this->dataSource === null) {
if ($this->input->getOption('defaults')) {
$this->dataSource = new DefaultsDataProvider();
} elseif ($this->input->getOption('file')) {
$this->dataSource = new FileDataProvider($this->input);
} else {
$this->dataSource = new UserDataProvider($this->input, $this->output, $this->getHelperSet()->get('question'));
}