Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 040a9ab

Browse files
chs2fabpot
authored andcommitted
dumpFile(), preserve existing file permissions
1 parent 3effed8 commit 040a9ab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,10 @@ public function dumpFile($filename, $content, $mode = 0666)
516516
}
517517

518518
$this->chmod($tmpFile, $mode);
519+
} else {
520+
@chmod($tmpFile, file_exists($filename) ? fileperms($filename) : 0666 & ~umask());
519521
}
522+
520523
$this->rename($tmpFile, $filename, true);
521524
}
522525

0 commit comments

Comments
 (0)