FileDumper does no backup.

This commit is contained in:
Clemens Tolboom 2012-05-16 16:03:46 +02:00
parent f14961b747
commit 189874d056

View File

@ -37,11 +37,12 @@ abstract class FileDumper implements DumperInterface
foreach ($messages->getDomains() as $domain) {
$file = $domain.'.'.$messages->getLocale().'.'.$this->getExtension();
// backup
if (file_exists($options['path'].$file)) {
copy($options['path'].$file, $options['path'].'/'.$file.'~');
$fullpath = $options['path'].'/'.$file;
if (file_exists($fullpath)) {
copy($fullpath, $fullpath.'~');
}
// save file
file_put_contents($options['path'].'/'.$file, $this->format($messages, $domain));
file_put_contents($fullpath, $this->format($messages, $domain));
}
}