mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-08-30 02:52:22 +08:00
Fix InstallActionHandler
This commit is contained in:
parent
d2a0c04724
commit
759c4c0011
1 changed files with 14 additions and 8 deletions
|
@ -106,7 +106,13 @@ class InstallActionHandler implements ProcessHandlerInterface
|
||||||
if (empty($process->getOptions())) {
|
if (empty($process->getOptions())) {
|
||||||
throw new InvalidArgumentException(self::MSG_OPTIONS_NOT_FOUND);
|
throw new InvalidArgumentException(self::MSG_OPTIONS_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function run(Process $process)
|
||||||
|
{
|
||||||
$options = $process->getOptions();
|
$options = $process->getOptions();
|
||||||
|
|
||||||
$validOptions = [
|
$validOptions = [
|
||||||
|
@ -120,19 +126,19 @@ class InstallActionHandler implements ProcessHandlerInterface
|
||||||
'db_name'
|
'db_name'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$missingOptions = [];
|
||||||
foreach ($validOptions as $validOption) {
|
foreach ($validOptions as $validOption) {
|
||||||
if (empty($options['payload'][$validOption])) {
|
if (empty($options['payload'][$validOption])) {
|
||||||
throw new InvalidArgumentException(self::MSG_OPTIONS_NOT_FOUND);
|
$missingOptions[] = $validOption;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
if(!empty($missingOptions)){
|
||||||
* @inheritDoc
|
$process->setStatus('error');
|
||||||
*/
|
$process->setMessages(['Missing required options: ' . implode(', ', $missingOptions)]);
|
||||||
public function run(Process $process)
|
$process->setData([]);
|
||||||
{
|
return;
|
||||||
$options = $process->getOptions();
|
}
|
||||||
|
|
||||||
global $installing;
|
global $installing;
|
||||||
$installing = true;
|
$installing = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue