Skip to content

Commit 98f013f

Browse files
Merge branch '2.7' into 2.8
* 2.7: bug symfony#14246 [Filesystem] dumpFile() non atomic
2 parents 3676c3b + ddab627 commit 98f013f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,14 +530,14 @@ public function dumpFile($filename, $content, $mode = 0666)
530530
throw new IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename);
531531
}
532532

533-
$this->rename($tmpFile, $filename, true);
534533
if (null !== $mode) {
535534
if (func_num_args() > 2) {
536535
@trigger_error('Support for modifying file permissions is deprecated since version 2.3.12 and will be removed in 3.0.', E_USER_DEPRECATED);
537536
}
538537

539-
$this->chmod($filename, $mode);
538+
$this->chmod($tmpFile, $mode);
540539
}
540+
$this->rename($tmpFile, $filename, true);
541541
}
542542

543543
/**

0 commit comments

Comments
 (0)