minor fixes in installation process
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -57,12 +57,16 @@ final class InstallCommand extends Command
|
||||
{
|
||||
$result = self::SUCCESS;
|
||||
|
||||
if ($input->getOption('create-userdata-from-str') !== false) {
|
||||
if ($input->getOption('create-userdata-from-str') !== null) {
|
||||
$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;
|
||||
$ud_dec = @json_decode(@base64_decode($ud_str), true);
|
||||
if (is_array($ud_dec) && !empty($ud_dec) && count($ud_dec) == 8) {
|
||||
$core = new Core($ud_dec);
|
||||
$core->createUserdataConf();
|
||||
return $result;
|
||||
}
|
||||
$output->writeln("<error>Invalid parameter value.</>");
|
||||
return self::INVALID;
|
||||
}
|
||||
|
||||
session_start();
|
||||
@@ -130,6 +134,7 @@ final class InstallCommand extends Command
|
||||
$this->io->info('Running unattended installation');
|
||||
} else {
|
||||
$extended = $this->io->confirm('Use advanced installation mode?', false);
|
||||
$decoded_input = [];
|
||||
}
|
||||
|
||||
$result = $this->showStep(0, $extended, $decoded_input);
|
||||
@@ -246,7 +251,7 @@ final class InstallCommand extends Command
|
||||
if ($step == 3) {
|
||||
// do actual install with data from $this->formfielddata
|
||||
$core = new Core($this->formfielddata);
|
||||
$core->doInstall();
|
||||
$core->doInstall(false);
|
||||
$core->createUserdataConf();
|
||||
}
|
||||
return $this->showStep(++$step, $extended, $decoded_input);
|
||||
|
||||
@@ -52,7 +52,7 @@ class Core
|
||||
* @return void
|
||||
* @throws Exception
|
||||
*/
|
||||
public function doInstall()
|
||||
public function doInstall(bool $create_ud_str = true)
|
||||
{
|
||||
$options = [
|
||||
'PDO::MYSQL_ATTR_INIT_COMMAND' => 'SET names utf8'
|
||||
@@ -116,7 +116,9 @@ class Core
|
||||
$this->doDataEntries($pdo);
|
||||
// create JSON array for config-services
|
||||
$this->createJsonArray();
|
||||
$this->createUserdataParamStr();
|
||||
if ($create_ud_str) {
|
||||
$this->createUserdataParamStr();
|
||||
}
|
||||
}
|
||||
|
||||
public function getUnprivilegedPdo(): PDO
|
||||
|
||||
@@ -220,7 +220,7 @@ return [
|
||||
'system' => [
|
||||
'label' => lng('install.install.runcmd'),
|
||||
'type' => 'textarea',
|
||||
'value' => (!empty($_SESSION['installation']['ud_str']) ? Froxlor::getInstallDir() . "bin/froxlor-cli froxlor:install -c '" . $_SESSION['installation']['ud_str'] . "'" : "something went wrong...") . "\n" .
|
||||
'value' => (!empty($_SESSION['installation']['ud_str']) ? Froxlor::getInstallDir() . "bin/froxlor-cli froxlor:install -c '" . $_SESSION['installation']['ud_str'] . "'\n" : "") .
|
||||
(!empty($_SESSION['installation']['json_params']) ? Froxlor::getInstallDir() . "bin/froxlor-cli froxlor:config-services -a '" . $_SESSION['installation']['json_params'] . "' --yes-to-all" : "something went wrong..."),
|
||||
'readonly' => true,
|
||||
'rows' => 10,
|
||||
|
||||
Reference in New Issue
Block a user