MDL-43794 Files API Set the mtime of files to extraction time.

The restore cleanup code expects the mtime to be the time of extraction
not the mtime before archiving. If set to the old mtime, the restore
files may be cleaned up before the restore is complete.

This behaviour also matches the behaviour of the zip unpacker.
This commit is contained in:
Eric Merrill
2014-01-22 11:07:07 -05:00
parent 0e088aec08
commit ff71f55265
+4 -2
View File
@@ -456,8 +456,10 @@ class tgz_extractor {
'Failed to close output file: ' . $this->currentfile);
}
// Update modified time.
touch($this->currentfile, $this->currentmtime);
// At this point we should touch the file to set its modified
// time to $this->currentmtime. However, when extracting to the
// temp directory, cron will delete files more than a week old,
// so to avoid problems we leave all files at their current time.
}
if ($this->currentarchivepath === tgz_packer::ARCHIVE_INDEX_FILE) {