diff --git a/setup/runtimeenv.class.inc.php b/setup/runtimeenv.class.inc.php index ea464b1eb..808293a01 100644 --- a/setup/runtimeenv.class.inc.php +++ b/setup/runtimeenv.class.inc.php @@ -167,7 +167,8 @@ class RunTimeEnvironment } if (! isset($_SESSION)) { - $_SESSION = []; + Session::$bAllowCLI = true; + Session::Start(); } Session::Set('itop_env', $this->sBuildEnv); @@ -1024,6 +1025,10 @@ class RunTimeEnvironment @rmdir(dirname($sBuildConfig)); // Cleanup the temporary build dir if empty MetaModel::ResetAllCaches($this->sFinalEnv); + if (! isset($_SESSION)) { + Session::$bAllowCLI = true; + Session::Start(); + } Session::Set('itop_env', $this->sFinalEnv); } } diff --git a/setup/sequencers/ApplicationInstallSequencer.php b/setup/sequencers/ApplicationInstallSequencer.php index 920fd6b80..11e37b02c 100644 --- a/setup/sequencers/ApplicationInstallSequencer.php +++ b/setup/sequencers/ApplicationInstallSequencer.php @@ -175,11 +175,14 @@ class ApplicationInstallSequencer extends StepSequencer } /** + * @param \Config $oConfig * @param $aSelectedModules * - * @throws \ConfigException * @throws \CoreException + * @throws \DictExceptionUnknownLanguage * @throws \MySQLException + * @throws \MySQLHasGoneAwayException + * @throws \OQLException */ protected function DoUpdateDBSchema(Config $oConfig, $aSelectedModules) { diff --git a/setup/wizardcontroller.class.inc.php b/setup/wizardcontroller.class.inc.php index 6eb2076e8..9f7eee90e 100644 --- a/setup/wizardcontroller.class.inc.php +++ b/setup/wizardcontroller.class.inc.php @@ -149,8 +149,7 @@ class WizardController { $sCurrentStepClass = utils::ReadParam('_class', $this->sInitialStepClass); $sCurrentState = utils::ReadParam('_state', $this->sInitialState); - /** @var \WizardStep $oStep */ - $oStep = $oStep = $this->GetWizardStep($sCurrentStepClass, $sCurrentState); + $oStep = $this->GetWizardStep($sCurrentStepClass, $sCurrentState); if ($oStep->ValidateParams()) { if ($oStep->CanComeBack()) { $this->PushStep(['class' => $sCurrentStepClass, 'state' => $sCurrentState]); @@ -177,7 +176,7 @@ class WizardController $sCurrentStepClass = utils::ReadParam('_class', $this->sInitialStepClass); $sCurrentState = utils::ReadParam('_state', $this->sInitialState); $oStep = $this->GetWizardStep($sCurrentStepClass, $sCurrentState); - $oWizardState = $oStep->UpdateWizardStateAndGetNextStep(false); // false => Moving backwards + $oStep->UpdateWizardStateAndGetNextStep(false); // false => Moving backwards // Display the previous step $aCurrentStepInfo = $this->PopStep(); diff --git a/setup/wizardsteps/WizStepInstall.php b/setup/wizardsteps/WizStepInstall.php index 3ca39852a..4042790b7 100644 --- a/setup/wizardsteps/WizStepInstall.php +++ b/setup/wizardsteps/WizStepInstall.php @@ -68,12 +68,10 @@ class WizStepInstall extends AbstractWizStepInstall $oPage->add(''); // progress_content $oPage->add(''); $oPage->add("
"); - } public function Display(WebPage $oPage) { - $aInstallParams = $this->BuildConfig(); $this->AddProgressBar($oPage, 'Progress of the installation'); @@ -91,27 +89,10 @@ JS); return; } - //When the setup reach this step, it already checked whether extensions were uninstallable (during WizStepModulesChoice). We only need to log what has been done. - if ($this->oWizard->GetParameter('force-uninstall', false)) { - SetupLog::Warning("User disabled uninstallation checks"); - } - $aExtensionsRemoved = json_decode($this->oWizard->GetParameter('removed_extensions'), true) ?? []; - $aExtensionsNotUninstallable = json_decode($this->oWizard->GetParameter('extensions_not_uninstallable')); - $aExtensionsForceUninstalled = []; - foreach ($aExtensionsRemoved as $sExtensionCode => $sLabel) { - if (in_array($sExtensionCode, $aExtensionsNotUninstallable)) { - $aExtensionsForceUninstalled[] = $sExtensionCode; - } - } - if (count($aExtensionsForceUninstalled)) { - SetupLog::Warning("Extensions uninstalled forcefully : ".implode(',', $aExtensionsForceUninstalled)); - } - $oPage->add_ready_script(<<ExecuteStep($sStep); - if (($aRes['status'] != $oInstaller::ERROR) && ($aRes['next-step'] != '')) { + if (($aRes['status'] !== StepSequencer::ERROR) && ($aRes['next-step'] != '')) { // Tell the web page to move the progress bar and to launch the next step $sMessage = addslashes(utils::EscapeHtml($aRes['next-step-label'])); $oPage->add_ready_script( @@ -140,7 +121,7 @@ JS); ExecuteStep('{$aRes['next-step']}'); EOF ); - } elseif ($aRes['status'] != $oInstaller::ERROR) { + } elseif ($aRes['status'] !== StepSequencer::ERROR) { // Installation complete, move to the next step of the wizard $oPage->add_ready_script( <<oWizard->SetParameter('extensions_added', json_encode($aExtensionsAdded)); $this->oWizard->SetParameter('removed_extensions', json_encode($aExtensionsRemoved)); $this->oWizard->SetParameter('extensions_not_uninstallable', json_encode(array_keys($aExtensionsNotUninstallable))); - $sMode = $this->oWizard->GetParameter('mode', 'install'); - if ($sMode == 'install' || !$this->IsDataAuditEnabled()) { - return new WizardState(WizStepSummary::class); - } else { - return new WizardState(WizStepDataAudit::class); - } + return new WizardState(WizStepDataAudit::class); } }