N°9503 Fix broken symlink in setup wizard

This commit is contained in:
Timmy38
2026-04-13 14:27:36 +02:00
parent 1222507205
commit 8172910c8b
3 changed files with 14 additions and 6 deletions

View File

@@ -54,9 +54,8 @@ class DataAuditSequencer extends StepSequencer
$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;
$bUseSymbolicLinks = $this->oParams->Get('use-symbolic-links', null) === 'on' ?? false;
$sMessage = $bUseSymbolicLinks ? '' : 'Using symbolic links instead of copying data model files (for developers only!)';
$this->oRunTimeEnvironment->DoCompile(
$aRemovedExtensionCodes,

View File

@@ -846,14 +846,19 @@ class SetupUtils
// Skip
continue;
}
if (is_dir($sSource.'/'.$sFile)) {
$sSourcePath = $sSource.'/'.$sFile;
$sDestPath = $sDest.'/'.$sFile;
if (is_dir($sSourcePath)) {
// Recurse
self::copydir($sSource.'/'.$sFile, $sDest.'/'.$sFile, $bUseSymbolicLinks);
self::copydir($sSourcePath, $sDestPath, $bUseSymbolicLinks);
} elseif (is_link($sSourcePath)) {
$sLinkPath = readlink($sSourcePath);
symlink($sLinkPath, $sDestPath);
} else {
if ($bUseSymbolicLinks) {
symlink($sSource.'/'.$sFile, $sDest.'/'.$sFile);
symlink($sSourcePath, $sDestPath);
} else {
copy($sSource.'/'.$sFile, $sDest.'/'.$sFile);
copy($sSourcePath, $sDestPath);
}
}
}
@@ -862,6 +867,9 @@ class SetupUtils
} elseif (is_file($sSource)) {
if ($bUseSymbolicLinks) {
return symlink($sSource, $sDest);
} elseif (is_link($sSource)) {
$sLinkPath = readlink($sSource);
return symlink($sLinkPath, $sDest);
} else {
return copy($sSource, $sDest);
}

View File

@@ -41,6 +41,7 @@ class WizStepInstallMiscParams extends AbstractWizStepMiscParams
$this->oWizard->SaveParameter('application_url', '');
$this->oWizard->SaveParameter('graphviz_path', '');
$this->oWizard->SaveParameter('sample_data', 'yes');
$this->oWizard->SaveParameter('use-symbolic-links', MFCompiler::UseSymbolicLinks());
return new WizardState(WizStepModulesChoice::class, 'start_install');
}