Skip to content

Commit

Permalink
allow to disable backups
Browse files Browse the repository at this point in the history
  • Loading branch information
nediam committed Feb 12, 2016
1 parent 0412e2d commit 5183a75
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Service/PhraseApp.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ class PhraseApp implements LoggerAwareInterface
*/
private $fileMerger;

/**
* @var bool
*/
private $backup = true;

/**
* @param PhraseAppClient $client
* @param TranslationLoader $translationLoader
Expand Down Expand Up @@ -144,6 +149,18 @@ public function setOutputFormat($outputFormat)
return $this;
}

/**
* @param boolean $backup
*
* @return PhraseApp
*/
public function setBackup($backup)
{
$this->backup = $backup;

return $this;
}

/**
* Get Locales
*
Expand Down Expand Up @@ -258,6 +275,11 @@ protected function dumpMessages($targetLocale)
}

$this->logger->notice('Writing translation file for locale "{locale}".', ['locale' => $targetLocale]);

if (false === $this->backup) {
$this->translationWriter->disableBackup();
}

$this->translationWriter->writeTranslations($extractedCatalogue, $this->outputFormat, ['path' => $this->translationsPath]);
}

Expand Down

0 comments on commit 5183a75

Please sign in to comment.