oWizard->SaveParameter('previous_version_dir', ''); $this->oWizard->SaveParameter('db_server', ''); $this->oWizard->SaveParameter('db_user', ''); $this->oWizard->SaveParameter('db_pwd', ''); $this->oWizard->SaveParameter('db_name', ''); $this->oWizard->SaveParameter('db_prefix', ''); $this->oWizard->SaveParameter('db_tls_enabled', false); $this->oWizard->SaveParameter('db_tls_ca', ''); if ($sInstallMode == 'install') { $this->oWizard->SetParameter('install_mode', 'install'); $sFullSourceDir = SetupUtils::GetLatestDataModelDir(); $this->oWizard->SetParameter('source_dir', $sFullSourceDir); $this->oWizard->SetParameter('datamodel_version', SetupUtils::GetDataModelVersion($sFullSourceDir)); $sNextStep = WizStepLicense::class; } else { $this->oWizard->SetParameter('install_mode', 'upgrade'); $sNextStep = WizStepDetectedInfo::class; } return new WizardState($sNextStep); } public function Display(WebPage $oPage) { $sInstallMode = $this->oWizard->GetParameter('install_mode', ''); $sDBServer = $this->oWizard->GetParameter('db_server', ''); $sDBUser = $this->oWizard->GetParameter('db_user', ''); $sDBPwd = $this->oWizard->GetParameter('db_pwd', ''); $sDBName = $this->oWizard->GetParameter('db_name', ''); $sDBPrefix = $this->oWizard->GetParameter('db_prefix', ''); $sTlsEnabled = $this->oWizard->GetParameter('db_tls_enabled', false); $sTlsCA = $this->oWizard->GetParameter('db_tls_ca', ''); $sPreviousVersionDir = ''; if ($sInstallMode == '') { $aPreviousInstance = SetupUtils::GetPreviousInstance(APPROOT); if ($aPreviousInstance['found']) { $sInstallMode = 'upgrade'; $sDBServer = $aPreviousInstance['db_server']; $sDBUser = $aPreviousInstance['db_user']; $sDBPwd = $aPreviousInstance['db_pwd']; $sDBName = $aPreviousInstance['db_name']; $sDBPrefix = $aPreviousInstance['db_prefix']; $sTlsEnabled = $aPreviousInstance['db_tls_enabled']; $sTlsCA = $aPreviousInstance['db_tls_ca']; $this->oWizard->SaveParameter('graphviz_path', $aPreviousInstance['graphviz_path']); $sPreviousVersionDir = APPROOT; } else { $sInstallMode = 'install'; } } $sPreviousVersionDir = $this->oWizard->GetParameter('previous_version_dir', $sPreviousVersionDir); $sUpgradeInfoStyle = ''; if ($sInstallMode == 'install') { $sUpgradeInfoStyle = ' style="display: none;" '; } $oPage->add('
What do you want to do?
'); $sChecked = ($sInstallMode == 'install') ? ' checked ' : ''; $oPage->p(''); $sChecked = ($sInstallMode == 'upgrade') ? ' checked ' : ''; $sDisabled = (($sInstallMode == 'install') && (empty($sPreviousVersionDir))) ? ' disabled' : ''; $oPage->p(''); $sUpgradeDir = utils::HtmlEntities($sPreviousVersionDir); $oPage->add( <<
Location on the disk:
HTML ); SetupUtils::DisplayDBParameters( $oPage, false, $sDBServer, $sDBUser, $sDBPwd, $sDBName, $sDBPrefix, $sTlsEnabled, $sTlsCA, null ); $sAuthentToken = $this->oWizard->GetParameter('authent', ''); $oPage->add(''); //$oPage->add(''); $oPage->add_ready_script( <<add_ready_script( <<add_ready_script( <<add_ready_script( <<