Skip to content

Commit 9919b55

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: preserve the file modification time when mirroring directories use local PHP web server to test HTTP stream wrappers
2 parents b859456 + 899330a commit 9919b55

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: Filesystem.php

+3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ public function copy(string $originFile, string $targetFile, bool $overwriteNewe
7474
// Like `cp`, preserve executable permission bits
7575
self::box('chmod', $targetFile, fileperms($targetFile) | (fileperms($originFile) & 0111));
7676

77+
// Like `cp`, preserve the file modification time
78+
self::box('touch', $targetFile, filemtime($originFile));
79+
7780
if ($bytesCopied !== $bytesOrigin = filesize($originFile)) {
7881
throw new IOException(sprintf('Failed to copy the whole content of "%s" to "%s" (%g of %g bytes copied).', $originFile, $targetFile, $bytesCopied, $bytesOrigin), 0, null, $originFile);
7982
}

0 commit comments

Comments
 (0)