From c7f10ec4d455877b8df96c00f28ada0bcb84f17b Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Tue, 30 Jun 2015 09:55:23 +0200 Subject: [PATCH] [ticket/13891] Updated range description Does not count #0 as a potential record PHPBB3-13891 --- phpBB/language/en/cli.php | 2 +- phpBB/phpbb/console/command/reparser/reparse.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/phpBB/language/en/cli.php b/phpBB/language/en/cli.php index d1f229272c..b8e7d25f60 100644 --- a/phpBB/language/en/cli.php +++ b/phpBB/language/en/cli.php @@ -85,5 +85,5 @@ $lang = array_merge($lang, array( '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)', )); diff --git a/phpBB/phpbb/console/command/reparser/reparse.php b/phpBB/phpbb/console/command/reparser/reparse.php index a2b8b71818..e922ea90e3 100644 --- a/phpBB/phpbb/console/command/reparser/reparse.php +++ b/phpBB/phpbb/console/command/reparser/reparse.php @@ -56,7 +56,7 @@ class reparse extends \phpbb\console\command\command null, InputOption::VALUE_REQUIRED, $this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE_OPT_RANGE_MIN'), - 0 + 1 ) ->addOption( '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) . ''); - $progress = new ProgressBar($output, $max - $min); + $progress = new ProgressBar($output, $max + 1 - $min); $progress->start(); // Start from $max and decrement $current by $size until we reach $min $current = $max; - while ($current > $min) + while ($current >= $min) { $start = max($min, $current + 1 - $size); - $end = $current; + $end = max($min, $current); $reparser->reparse_range($start, $end); - $current = max($min, $start - 1); - $progress->setProgress($max - $current); + $current = $start - 1; + $progress->setProgress($max + 1 - $start); } $progress->finish();