N°9503 Fix broken symlink in setup wizard (#881)

This commit is contained in:
Timmy38
2026-04-27 09:14:41 +02:00
committed by GitHub
parent d358c41c24
commit 7e0e357713
6 changed files with 19 additions and 11 deletions

View File

@@ -847,14 +847,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);
}
}
}
@@ -863,6 +868,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);
}