merged branch clemens-tolboom/filedumper-backup (PR #4302)
Commits -------189874d
FileDumper does no backup. Discussion ---------- FileDumper does no backup. Backup check path missed a '/'. So no backup was made. Removed the repeating path construction by replacing it by new variable. --------------------------------------------------------------------------- by travisbot at 2012-05-16T14:14:58Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1345963) (merged189874d0
into5314836d
).
This commit is contained in:
commit
e351c9f0a8
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user