Skip to content

Commit

Permalink
Fix debug mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
discordier committed Jul 10, 2015
1 parent a7c5e75 commit d77f159
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/CyberSpectrum/Command/ConvertToXliff.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,8 @@ protected function processLanguage(OutputInterface $output, $language)
$dstFile = $domain . '.xlf';
$destinationFiles[] = $dstFile;

$src = new ContaoFile($srcFile);
$base = new ContaoFile($basFile);
if ($output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG) {
$src->setDebugging();
$base->setDebugging();
}
$src = new ContaoFile($srcFile, ($output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG));
$base = new ContaoFile($basFile, ($output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG));

$dstDir = $this->getDestinationBasePath() . DIRECTORY_SEPARATOR . $language;
if (!is_dir($dstDir)) {
Expand All @@ -156,6 +152,11 @@ protected function processLanguage(OutputInterface $output, $language)
if (is_file($dstDir . DIRECTORY_SEPARATOR . $dstFile) || $dest->getKeys()) {
$dest->save();
}

if ($output->getVerbosity() >= OutputInterface::VERBOSITY_DEBUG) {
$output->writeln($src->getDebugMessages());
$output->writeln($base->getDebugMessages());
}
}

$this->cleanupObsoleteFiles($output, $language, $destinationFiles);
Expand Down

0 comments on commit d77f159

Please sign in to comment.