1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-04 14:47:52 +02:00

[ticket/13891] Handle verbosity

PHPBB3-13891
This commit is contained in:
Tristan Darricau 2015-07-02 13:40:02 +02:00
parent dd131d7439
commit 5970d0360c
2 changed files with 23 additions and 8 deletions

View File

@ -85,6 +85,7 @@ $lang = array_merge($lang, array(
'CLI_FIXUP_RECALCULATE_EMAIL_HASH_SUCCESS' => 'Successfully recalculated all email hashes.',
'CLI_REPARSER_REPARSE_REPARSING' => 'Reparsing %1$s (range %2$d..%3$d)',
'CLI_REPARSER_REPARSE_SUCCESS' => 'Reparsing ended with success',
'CLI_REPARSER_REPARSE_REPARSING' => 'Reparsing %1$s (range %2$d..%3$d)',
'CLI_REPARSER_REPARSE_REPARSING_START' => 'Reparsing %s...',
'CLI_REPARSER_REPARSE_SUCCESS' => 'Reparsing ended with success',
));

View File

@ -136,14 +136,28 @@ class reparse extends \phpbb\console\command\command
}
$this->io->section($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', str_replace('text_reparser.', '', $name), $min, $max));
$this->io->newLine(2);
$progress = $this->io->createProgressBar($max);
$progress->setFormat(
" %current:s%/%max:s% %bar% %percent:3s%%\n" .
" %message% %elapsed:6s%/%estimated:-6s% %memory:6s%\n");
$progress->setBarWidth(60);
$progress->setMessage('');
if ($output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE)
{
$progress->setFormat('<info>[%percent:3s%%]</info> %message%');
$progress->setOverwrite(false);
}
elseif ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE)
{
$progress->setFormat('<info>[%current:s%/%max:s%]</info><comment>[%elapsed%/%estimated%][%memory%]</comment> %message%');
$progress->setOverwrite(false);
}
else
{
$this->io->newLine(2);
$progress->setFormat(
" %current:s%/%max:s% %bar% %percent:3s%%\n" .
" %message% %elapsed:6s%/%estimated:-6s% %memory:6s%\n");
$progress->setBarWidth(60);
}
$progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING_START', str_replace('text_reparser.', '', $name)));
if (!defined('PHP_WINDOWS_VERSION_BUILD'))
{