update install action handlers

This commit is contained in:
p.kumar 2021-10-13 16:13:54 +05:30
parent 70cc80ee7e
commit 8ae636b4b3
4 changed files with 36 additions and 7 deletions

View file

@ -151,7 +151,7 @@ export class InstallViewStore implements StateStore {
id: '',
module: 'install',
attributes: {}
} as Record)
} as Record);
}
/**
@ -318,7 +318,8 @@ export class InstallViewStore implements StateStore {
"db_username",
"db_password",
"db_host",
"db_name"
"db_name",
"db_port"
],
display: "vertical",
groupFields: {
@ -354,6 +355,15 @@ export class InstallViewStore implements StateStore {
"labelKey": "LBL_DBCONF_DB_NAME",
"showLabel": ["*"],
"required": true,
},
"db_port": {
"name": "db_port",
"type": "varchar",
"vname": "LBL_DBCONF_DB_PORT",
"labelKey": "LBL_DBCONF_DB_PORT",
"showLabel": ["*"],
"required": false,
"default": "3306"
}
},
showLabel: {

View file

@ -102,6 +102,18 @@ class LegacyInstallCommand extends BaseStepExecutorCommand
'required' => false
];
$this->inputConfig['db_port'] = [
'question' => new Question('Please enter the db port: ', '3306'),
'argument' => new InputOption(
'db_port',
'Z',
InputOption::VALUE_REQUIRED,
'database port'
),
'default' => '3306',
'required' => false
];
$this->inputConfig['db_name'] = [
'question' => new Question('Please enter the db name: '),
'argument' => new InputOption(
@ -165,12 +177,12 @@ class LegacyInstallCommand extends BaseStepExecutorCommand
'question' => new ChoiceQuestion(
'Ignore system check warnings?: ',
['true', 'false'],
'true'
'false'
),
'argument' => new InputOption(
'sys_check_option',
'W',
InputOption::VALUE_OPTIONAL,
InputOption::VALUE_REQUIRED,
'Ignore "system check warnings" during install system acceptance check'
),
'default' => 'false',

View file

@ -85,7 +85,8 @@ class InstallHandler extends LegacyHandler
LegacyScopeState $legacyScopeState,
SessionInterface $session,
LoggerInterface $logger
) {
)
{
parent::__construct(
$projectDir,
$legacyDir,
@ -222,6 +223,7 @@ class InstallHandler extends LegacyHandler
'export_delimiter' => ',',
'setup_db_admin_password' => $inputArray['db_password'],
'setup_db_admin_user_name' => $inputArray['db_username'],
'setup_db_port_num' => $inputArray['db_port'],
'setup_db_create_database' => 1,
'setup_db_database_name' => $inputArray['db_name'],
'setup_db_drop_tables' => 0,
@ -260,7 +262,7 @@ class InstallHandler extends LegacyHandler
{
try {
new PDO(
"mysql:host=" . $inputArray["db_host"] . ";",
"mysql:host=" . $inputArray["db_host"] . ":" . $inputArray["db_port"] . ";",
$inputArray['db_username'],
$inputArray['db_password']
);

View file

@ -101,6 +101,10 @@ class InstallActionHandler implements ProcessHandlerInterface
$options = $process->getOptions();
if(empty($options['payload']['db_port'])){
$options['payload']['db_port'] = '3306';
}
$validOptions = [
'site_host',
'demoData',
@ -109,7 +113,8 @@ class InstallActionHandler implements ProcessHandlerInterface
'db_username',
'db_password',
'db_host',
'db_name'
'db_name',
'db_port'
];
foreach ($validOptions as $validOption) {