GettextTranslationHelper: Don't create backup files and cleanup temporary files

fixes #2683
This commit is contained in:
Johannes Meyer 2017-01-24 16:04:17 +01:00
parent 59cadde485
commit 2f8d4739b8
1 changed files with 15 additions and 1 deletions

View File

@ -121,6 +121,20 @@ class GettextTranslationHelper
$this->locale = $locale;
}
/**
* Cleanup temporary files
*/
public function __destruct()
{
if ($this->catalogPath !== null && file_exists($this->catalogPath)) {
unlink($this->catalogPath);
}
if ($this->templatePath !== null && file_exists($this->templatePath)) {
unlink($this->templatePath);
}
}
/**
* Get the config
*
@ -251,7 +265,7 @@ class GettextTranslationHelper
{
if (is_file($this->tablePath)) {
shell_exec(sprintf(
'%s --update %s %s 2>&1',
'%s --update --backup=none %s %s 2>&1',
$this->getConfig()->get('translation', 'msgmerge', '/usr/bin/env msgmerge'),
$this->tablePath,
$this->templatePath