aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/console
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-07-06 01:43:43 +0200
committerJoshyPHP <s9e.dev@gmail.com>2015-07-06 23:45:20 +0200
commit7ccb6389124c5e990abaa917a6684fc3f4d072db (patch)
tree41ed0ef6d95a77643f0499b34fdc81364e05505a /phpBB/phpbb/console
parentca5d4fd31031a47cc3a485457473b82660b84ed1 (diff)
downloadforums-7ccb6389124c5e990abaa917a6684fc3f4d072db.tar
forums-7ccb6389124c5e990abaa917a6684fc3f4d072db.tar.gz
forums-7ccb6389124c5e990abaa917a6684fc3f4d072db.tar.bz2
forums-7ccb6389124c5e990abaa917a6684fc3f4d072db.tar.xz
forums-7ccb6389124c5e990abaa917a6684fc3f4d072db.zip
[ticket/13987] Add --dry-run option to reparser CLI
PHPBB3-13987
Diffstat (limited to 'phpBB/phpbb/console')
-rw-r--r--phpBB/phpbb/console/command/reparser/reparse.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/phpBB/phpbb/console/command/reparser/reparse.php b/phpBB/phpbb/console/command/reparser/reparse.php
index 52075dd0ac..8352c523de 100644
--- a/phpBB/phpbb/console/command/reparser/reparse.php
+++ b/phpBB/phpbb/console/command/reparser/reparse.php
@@ -57,6 +57,12 @@ class reparse extends \phpbb\console\command\command
->setDescription($this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE'))
->addArgument('reparser-name', InputArgument::OPTIONAL, $this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE_ARG_1'))
->addOption(
+ 'dry-run',
+ null,
+ InputOption::VALUE_NONE,
+ $this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE_OPT_DRY_RUN')
+ )
+ ->addOption(
'range-min',
null,
InputOption::VALUE_REQUIRED,
@@ -126,9 +132,10 @@ class reparse extends \phpbb\console\command\command
$reparser = $this->reparsers[$name];
// Start at range-max if specified or at the highest ID otherwise
- $max = (is_null($input->getOption('range-max'))) ? $reparser->get_max_id() : $input->getOption('range-max');
- $min = $input->getOption('range-min');
- $size = $input->getOption('range-size');
+ $max = (is_null($input->getOption('range-max'))) ? $reparser->get_max_id() : $input->getOption('range-max');
+ $min = $input->getOption('range-min');
+ $size = $input->getOption('range-size');
+ $dry_run = $input->getOption('dry-run');
if ($max === 0)
{
@@ -176,7 +183,7 @@ class reparse extends \phpbb\console\command\command
$end = max($min, $current);
$progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', str_replace('text_reparser.', '', $name), $start, $end));
- $reparser->reparse_range($start, $end);
+ $reparser->reparse_range($start, $end, $dry_run);
$current = $start - 1;
$progress->setProgress($max + 1 - $start);