8000 merged branch clemens-tolboom/filedumper-backup (PR #4302) · symfony/symfony@e351c9f · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit e351c9f

Browse files
committed
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) (merged 189874d into 5314836).
2 parents e4eead3 + 189874d commit e351c9f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Symfony/Component/Translation/Dumper/FileDumper.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ public function dump(MessageCatalogue $messages, $options = array())
3737
foreach ($messages->getDomains() as $domain) {
3838
$file = $domain.'.'.$messages->getLocale().'.'.$this->getExtension();
3939
// backup
40-
if (file_exists($options['path'].$file)) {
41-
copy($options['path'].$file, $options['path'].'/'.$file.'~');
40+
$fullpath = $options['path'].'/'.$file;
41+
if (file_exists($fullpath)) {
42+
copy($fullpath, $fullpath.'~');
4243
}
4344
// save file
44-
file_put_contents($options['path'].'/'.$file, $this->format($messages, $domain));
45+
file_put_contents($fullpath, $this->format($messages, $domain));
4546
}
4647
}
4748

0 commit comments

Comments
 (0)
0