1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/17402] Add CLI reparser option to force reparsing BBCode

PHPBB-17402
This commit is contained in:
rxu
2024-09-28 18:28:49 +07:00
parent 914383a581
commit 2ac9c0ae7c
4 changed files with 25 additions and 14 deletions

View File

@@ -92,6 +92,12 @@ class reparse extends \phpbb\console\command\command
InputOption::VALUE_NONE,
$this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE_OPT_DRY_RUN')
)
->addOption(
'force-bbcode-reparsing',
null,
InputOption::VALUE_NONE,
$this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE_OPT_FORCE_BBCODE')
)
->addOption(
'resume',
null,
@@ -222,13 +228,15 @@ class reparse extends \phpbb\console\command\command
// Start from $max and decrement $current by $size until we reach $min
$current = $max;
$force_bbcode_reparsing = (bool) $this->get_option('force-bbcode-reparsing');
while ($current >= $min)
{
$start = max($min, $current + 1 - $size);
$end = max($min, $current);
$progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', $reparser->get_name(), $start, $end));
$reparser->reparse_range($start, $end);
$reparser->reparse_range($start, $end, $force_bbcode_reparsing);
$current = $start - 1;
$progress->setProgress($max + 1 - $start);