Skip to content

Commit 408105d

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: preserve the file modification time when mirroring directories use local PHP web server to test HTTP stream wrappers
2 parents 272184e + 9919b55 commit 408105d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Filesystem.php

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

75+
// Like `cp`, preserve the file modification time
76+
self::box('touch', $targetFile, filemtime($originFile));
77+
7578
if ($bytesCopied !== $bytesOrigin = filesize($originFile)) {
7679
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);
7780
}

0 commit comments

Comments
 (0)