fixes for finishing installation correctly

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-08-20 10:44:05 +02:00
parent 9dc95e086d
commit 2c9b2c1d67
7 changed files with 52 additions and 10 deletions

View File

@@ -49,13 +49,22 @@ final class InstallCommand extends Command
$this->setName('froxlor:install');
$this->setDescription('Installation process to use instead of web-ui');
$this->addArgument('input-file', InputArgument::OPTIONAL, 'Optional JSON array file to use for unattended installations');
$this->addOption('print-example-file', 'p', InputOption::VALUE_NONE, 'Outputs an example JSON content to be used with the input file parameter');
$this->addOption('print-example-file', 'p', InputOption::VALUE_NONE, 'Outputs an example JSON content to be used with the input file parameter')
->addOption('create-userdata-from-str', 'c', InputOption::VALUE_REQUIRED, 'Creates lib/userdata.inc.php file from string created by web-install process');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$result = self::SUCCESS;
if ($input->getOption('create-userdata-from-str') !== false) {
$ud_str = $input->getOption('create-userdata-from-str');
$ud_dec = json_decode(base64_decode($ud_str), true);
$core = new Core($ud_dec);
$core->createUserdataConf();
return $result;
}
session_start();
require __DIR__ . '/install.functions.php';