fix(vikon): use rename() instead of copy() for syncFiles - atomic, no extra disk space

This commit is contained in:
F4ilji
2026-07-04 19:09:13 +05:00
parent e502225e9c
commit 93bd3963bf
@@ -119,10 +119,10 @@ class UpdateCoreAction
if (File::exists($targetPath)) {
$oldPath = $targetPath . self::OLD_SUFFIX;
File::delete($oldPath);
@unlink($oldPath);
rename($targetPath, $oldPath);
}
copy($file->getPathname(), $targetPath);
rename($file->getPathname(), $targetPath);
}
foreach (File::directories($source) as $dir) {
@@ -131,11 +131,11 @@ class UpdateCoreAction
if (File::exists($targetPath)) {
$oldPath = $targetPath . self::OLD_SUFFIX;
File::deleteDirectory($oldPath);
File::move($targetPath, $oldPath);
$this->fs->safeRemove($oldPath, $target, true);
rename($targetPath, $oldPath);
}
File::copyDirectory($dir, $targetPath);
rename($dir, $targetPath);
}
}