mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-02 08:09:19 +08:00
update install action handlers
This commit is contained in:
parent
70cc80ee7e
commit
8ae636b4b3
4 changed files with 36 additions and 7 deletions
|
@ -151,7 +151,7 @@ export class InstallViewStore implements StateStore {
|
||||||
id: '',
|
id: '',
|
||||||
module: 'install',
|
module: 'install',
|
||||||
attributes: {}
|
attributes: {}
|
||||||
} as Record)
|
} as Record);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -318,7 +318,8 @@ export class InstallViewStore implements StateStore {
|
||||||
"db_username",
|
"db_username",
|
||||||
"db_password",
|
"db_password",
|
||||||
"db_host",
|
"db_host",
|
||||||
"db_name"
|
"db_name",
|
||||||
|
"db_port"
|
||||||
],
|
],
|
||||||
display: "vertical",
|
display: "vertical",
|
||||||
groupFields: {
|
groupFields: {
|
||||||
|
@ -354,6 +355,15 @@ export class InstallViewStore implements StateStore {
|
||||||
"labelKey": "LBL_DBCONF_DB_NAME",
|
"labelKey": "LBL_DBCONF_DB_NAME",
|
||||||
"showLabel": ["*"],
|
"showLabel": ["*"],
|
||||||
"required": true,
|
"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: {
|
showLabel: {
|
||||||
|
|
|
@ -102,6 +102,18 @@ class LegacyInstallCommand extends BaseStepExecutorCommand
|
||||||
'required' => false
|
'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'] = [
|
$this->inputConfig['db_name'] = [
|
||||||
'question' => new Question('Please enter the db name: '),
|
'question' => new Question('Please enter the db name: '),
|
||||||
'argument' => new InputOption(
|
'argument' => new InputOption(
|
||||||
|
@ -165,12 +177,12 @@ class LegacyInstallCommand extends BaseStepExecutorCommand
|
||||||
'question' => new ChoiceQuestion(
|
'question' => new ChoiceQuestion(
|
||||||
'Ignore system check warnings?: ',
|
'Ignore system check warnings?: ',
|
||||||
['true', 'false'],
|
['true', 'false'],
|
||||||
'true'
|
'false'
|
||||||
),
|
),
|
||||||
'argument' => new InputOption(
|
'argument' => new InputOption(
|
||||||
'sys_check_option',
|
'sys_check_option',
|
||||||
'W',
|
'W',
|
||||||
InputOption::VALUE_OPTIONAL,
|
InputOption::VALUE_REQUIRED,
|
||||||
'Ignore "system check warnings" during install system acceptance check'
|
'Ignore "system check warnings" during install system acceptance check'
|
||||||
),
|
),
|
||||||
'default' => 'false',
|
'default' => 'false',
|
||||||
|
|
|
@ -85,7 +85,8 @@ class InstallHandler extends LegacyHandler
|
||||||
LegacyScopeState $legacyScopeState,
|
LegacyScopeState $legacyScopeState,
|
||||||
SessionInterface $session,
|
SessionInterface $session,
|
||||||
LoggerInterface $logger
|
LoggerInterface $logger
|
||||||
) {
|
)
|
||||||
|
{
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$projectDir,
|
$projectDir,
|
||||||
$legacyDir,
|
$legacyDir,
|
||||||
|
@ -222,6 +223,7 @@ class InstallHandler extends LegacyHandler
|
||||||
'export_delimiter' => ',',
|
'export_delimiter' => ',',
|
||||||
'setup_db_admin_password' => $inputArray['db_password'],
|
'setup_db_admin_password' => $inputArray['db_password'],
|
||||||
'setup_db_admin_user_name' => $inputArray['db_username'],
|
'setup_db_admin_user_name' => $inputArray['db_username'],
|
||||||
|
'setup_db_port_num' => $inputArray['db_port'],
|
||||||
'setup_db_create_database' => 1,
|
'setup_db_create_database' => 1,
|
||||||
'setup_db_database_name' => $inputArray['db_name'],
|
'setup_db_database_name' => $inputArray['db_name'],
|
||||||
'setup_db_drop_tables' => 0,
|
'setup_db_drop_tables' => 0,
|
||||||
|
@ -260,7 +262,7 @@ class InstallHandler extends LegacyHandler
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
new PDO(
|
new PDO(
|
||||||
"mysql:host=" . $inputArray["db_host"] . ";",
|
"mysql:host=" . $inputArray["db_host"] . ":" . $inputArray["db_port"] . ";",
|
||||||
$inputArray['db_username'],
|
$inputArray['db_username'],
|
||||||
$inputArray['db_password']
|
$inputArray['db_password']
|
||||||
);
|
);
|
||||||
|
|
|
@ -101,6 +101,10 @@ class InstallActionHandler implements ProcessHandlerInterface
|
||||||
|
|
||||||
$options = $process->getOptions();
|
$options = $process->getOptions();
|
||||||
|
|
||||||
|
if(empty($options['payload']['db_port'])){
|
||||||
|
$options['payload']['db_port'] = '3306';
|
||||||
|
}
|
||||||
|
|
||||||
$validOptions = [
|
$validOptions = [
|
||||||
'site_host',
|
'site_host',
|
||||||
'demoData',
|
'demoData',
|
||||||
|
@ -109,7 +113,8 @@ class InstallActionHandler implements ProcessHandlerInterface
|
||||||
'db_username',
|
'db_username',
|
||||||
'db_password',
|
'db_password',
|
||||||
'db_host',
|
'db_host',
|
||||||
'db_name'
|
'db_name',
|
||||||
|
'db_port'
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($validOptions as $validOption) {
|
foreach ($validOptions as $validOption) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue