[BUGFIX] LanguagePackCommand: Hide progress output by default 30/57530/10
authorJosef Glatz <josefglatz@gmail.com>
Wed, 11 Jul 2018 08:54:23 +0000 (10:54 +0200)
committerMathias Brodala <mbrodala@pagemachine.de>
Fri, 13 Jul 2018 07:49:41 +0000 (09:49 +0200)
Show progress bar only if verbosity level is set. The default output
of this command is disabled by default to limit the amount of e-mails
sent by the TYPO3 scheduler (which normally makes only sense, if any
error occurs).

You can activate the output if you set the verbosity while calling the
command ("-v" option).

Resolves: #85533
Releases: master
Change-Id: I6f95559cc1228afd66192f7382e81f9ae91c0ed8
Reviewed-on: https://review.typo3.org/57530
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Alexander Grein <alexander.grein@gmail.com>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
typo3/sysext/install/Classes/Command/LanguagePackCommand.php

index 8ccaef6..ef180c3 100644 (file)
@@ -19,6 +19,7 @@ use Symfony\Component\Console\Command\Command;
 use Symfony\Component\Console\Helper\ProgressBar;
 use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\NullOutput;
 use Symfony\Component\Console\Output\OutputInterface;
 use TYPO3\CMS\Core\Cache\CacheManager;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -70,13 +71,21 @@ class LanguagePackCommand extends Command
             $isos = $languagePackService->getActiveLanguages();
         }
 
-        $output->writeln(sprintf(
-            '<info>Updating language packs of all activated extensions for locale(s) "%s"</info>',
-            implode('", "', $isos)
-        ));
+        if ($output->isVerbose()) {
+            $output->writeln(sprintf(
+                '<info>Updating language packs of all activated extensions for locale(s) "%s"</info>',
+                implode('", "', $isos)
+            ));
+        }
 
         $extensions = $languagePackService->getExtensionLanguagePackDetails();
-        $progressBar = new ProgressBar($output, count($isos) * count($extensions));
+
+        if (!$output->isVerbose()) {
+            $progressBarOutput = new NullOutput();
+        } else {
+            $progressBarOutput = $output;
+        }
+        $progressBar = new ProgressBar($progressBarOutput, count($isos) * count($extensions));
         $languagePackService->updateMirrorBaseUrl();
         foreach ($isos as $iso) {
             foreach ($extensions as $extension) {