GetNextStep('copy', 'Copying data model files', 5); case 'copy': $this->oRunTimeEnvironment->CopySetupFiles(); return $this->GetNextStep('compile', 'Compiling the data model', 20, 'Copying...'); case 'compile': $aSelectedModules = $this->oParams->Get('selected_modules'); $sSourceDir = $this->oParams->Get('source_dir', 'datamodels/latest'); $sExtensionDir = $this->oParams->Get('extensions_dir', 'extensions'); $aMiscOptions = $this->oParams->Get('options', []); $aRemovedExtensionCodes = $this->oParams->Get('removed_extensions', []); $bUseSymbolicLinks = $aMiscOptions['symlinks'] ?? false; $sMessage = $bUseSymbolicLinks ? '' : 'Using symbolic links instead of copying data model files (for developers only!)'; $this->oRunTimeEnvironment->DoCompile( $aRemovedExtensionCodes, $aSelectedModules, $sSourceDir, $sExtensionDir, $bUseSymbolicLinks ); return $this->GetNextStep('setup-audit', 'Checking data consistency with the new data model', 70, $sMessage); case 'setup-audit': if ($this->IsDataAuditRequired()) { $this->oRunTimeEnvironment->DataToCleanupAudit(); } return $this->GetNextStep('', 'Completed', 100); default: return $this->GetNextStep('', "Unknown setup step '$sStep'.", 100, '', self::ERROR); } } catch (Exception $e) { SetupLog::Exception("$sStep failed", $e); $aResult = $this->GetNextStep('', '', 100, $e->getMessage(), self::ERROR); $aResult['error_code'] = $e->getCode(); return $aResult; } finally { $fDuration = round(microtime(true) - $fStart, 2); SetupLog::Info("##### STEP {$sStep} duration: {$fDuration}s"); } } protected function IsDataAuditRequired(): bool { if ('install' === $this->oParams->Get('mode')) { return false; } $sFinalEnvDir = APPROOT.'env-'.$this->oRunTimeEnvironment->GetFinalEnv(); return is_dir($sFinalEnvDir); } }