Add option to write the config file to a different path

This commit is contained in:
Toby Zerner
2016-06-03 10:55:50 +09:30
parent 4bd05ee561
commit 1ce6afaaeb

View File

@ -69,6 +69,12 @@ class InstallCommand extends AbstractCommand
'f', 'f',
InputOption::VALUE_REQUIRED, InputOption::VALUE_REQUIRED,
'Use external configuration file in YAML format' 'Use external configuration file in YAML format'
)
->addOption(
'config',
'c',
InputOption::VALUE_REQUIRED,
'Set the path to write the config file to'
); );
} }
@ -187,7 +193,7 @@ class InstallCommand extends AbstractCommand
$dbConfig = $this->dbConfig; $dbConfig = $this->dbConfig;
$config = [ $config = [
'debug' => true, 'debug' => false,
'database' => [ 'database' => [
'driver' => $dbConfig['driver'], 'driver' => $dbConfig['driver'],
'host' => $dbConfig['host'], 'host' => $dbConfig['host'],
@ -364,7 +370,7 @@ class InstallCommand extends AbstractCommand
protected function getConfigFile() protected function getConfigFile()
{ {
return base_path('config.php'); return $this->input->getOption('config') ?: base_path('config.php');
} }
/** /**