aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/console/command
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2015-07-07 17:25:28 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2015-07-07 17:25:28 +0200
commit2fbfb0e00436acc090a55e1739cf8bdd3b5c4497 (patch)
tree03bda2fcceca020ddc486ded2aafe32ae0c33d4b /phpBB/phpbb/console/command
parent39d3a026fe30c9ca3b276039e673cec0548e1eff (diff)
parentcf4cdcda586a2371aa92ae452951f9660737ae09 (diff)
downloadforums-2fbfb0e00436acc090a55e1739cf8bdd3b5c4497.tar
forums-2fbfb0e00436acc090a55e1739cf8bdd3b5c4497.tar.gz
forums-2fbfb0e00436acc090a55e1739cf8bdd3b5c4497.tar.bz2
forums-2fbfb0e00436acc090a55e1739cf8bdd3b5c4497.tar.xz
forums-2fbfb0e00436acc090a55e1739cf8bdd3b5c4497.zip
Merge pull request #3744 from s9e/ticket/13987
[ticket/13987] Add --dry-run option to reparser CLI
Diffstat (limited to 'phpBB/phpbb/console/command')
-rw-r--r--phpBB/phpbb/console/command/reparser/reparse.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/phpBB/phpbb/console/command/reparser/reparse.php b/phpBB/phpbb/console/command/reparser/reparse.php
index 52075dd0ac..151e196358 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,
@@ -124,6 +130,14 @@ class reparse extends \phpbb\console\command\command
protected function reparse(InputInterface $input, OutputInterface $output, $name)
{
$reparser = $this->reparsers[$name];
+ if ($input->getOption('dry-run'))
+ {
+ $reparser->disable_save();
+ }
+ else
+ {
+ $reparser->enable_save();
+ }
// 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');