Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 5.4:
  preserve the file modification time when mirroring directories
  use local PHP web server to test HTTP stream wrappers
  • Loading branch information
xabbuh committed Mar 21, 2024
2 parents b859456 + 899330a commit 9919b55
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public function copy(string $originFile, string $targetFile, bool $overwriteNewe
// Like `cp`, preserve executable permission bits
self::box('chmod', $targetFile, fileperms($targetFile) | (fileperms($originFile) & 0111));

// Like `cp`, preserve the file modification time
self::box('touch', $targetFile, filemtime($originFile));

if ($bytesCopied !== $bytesOrigin = filesize($originFile)) {
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);
}
Expand Down

0 comments on commit 9919b55

Please sign in to comment.