1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-25 04:24:31 +02:00

[ticket/13891] Updated range description

Does not count #0 as a potential record

PHPBB3-13891
This commit is contained in:
JoshyPHP
2015-06-30 09:55:23 +02:00
parent 6de5e5cc36
commit c7f10ec4d4
2 changed files with 7 additions and 7 deletions

View File

@ -85,5 +85,5 @@ $lang = array_merge($lang, array(
'CLI_FIXUP_RECALCULATE_EMAIL_HASH_SUCCESS' => 'Successfully recalculated all email hashes.', 'CLI_FIXUP_RECALCULATE_EMAIL_HASH_SUCCESS' => 'Successfully recalculated all email hashes.',
'CLI_REPARSER_REPARSE_REPARSING' => 'Reparsing %1$s from %2$d to %3$d', 'CLI_REPARSER_REPARSE_REPARSING' => 'Reparsing %1$s (range %2$d..%3$d)',
)); ));

View File

@ -56,7 +56,7 @@ class reparse extends \phpbb\console\command\command
null, null,
InputOption::VALUE_REQUIRED, InputOption::VALUE_REQUIRED,
$this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE_OPT_RANGE_MIN'), $this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE_OPT_RANGE_MIN'),
0 1
) )
->addOption( ->addOption(
'range-max', 'range-max',
@ -123,19 +123,19 @@ class reparse extends \phpbb\console\command\command
$output->writeLn($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', str_replace('text_reparser.', '', $name), $min, $max) . '</info>'); $output->writeLn($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', str_replace('text_reparser.', '', $name), $min, $max) . '</info>');
$progress = new ProgressBar($output, $max - $min); $progress = new ProgressBar($output, $max + 1 - $min);
$progress->start(); $progress->start();
// Start from $max and decrement $current by $size until we reach $min // Start from $max and decrement $current by $size until we reach $min
$current = $max; $current = $max;
while ($current > $min) while ($current >= $min)
{ {
$start = max($min, $current + 1 - $size); $start = max($min, $current + 1 - $size);
$end = $current; $end = max($min, $current);
$reparser->reparse_range($start, $end); $reparser->reparse_range($start, $end);
$current = max($min, $start - 1); $current = $start - 1;
$progress->setProgress($max - $current); $progress->setProgress($max + 1 - $start);
} }
$progress->finish(); $progress->finish();