aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/console/command
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2015-07-06 01:57:54 +0200
committerJoshyPHP <s9e.dev@gmail.com>2015-07-06 23:45:38 +0200
commitcf4cdcda586a2371aa92ae452951f9660737ae09 (patch)
tree15cab3410c1a38bf7520f9dc7745d8c4056f16b9 /phpBB/phpbb/console/command
parent7ccb6389124c5e990abaa917a6684fc3f4d072db (diff)
downloadforums-cf4cdcda586a2371aa92ae452951f9660737ae09.tar
forums-cf4cdcda586a2371aa92ae452951f9660737ae09.tar.gz
forums-cf4cdcda586a2371aa92ae452951f9660737ae09.tar.bz2
forums-cf4cdcda586a2371aa92ae452951f9660737ae09.tar.xz
forums-cf4cdcda586a2371aa92ae452951f9660737ae09.zip
[ticket/13987] Replaced optional parameter with explicit API
Added disable_save() and enable_save() to toggle a dry run PHPBB3-13987
Diffstat (limited to 'phpBB/phpbb/console/command')
-rw-r--r--phpBB/phpbb/console/command/reparser/reparse.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/phpBB/phpbb/console/command/reparser/reparse.php b/phpBB/phpbb/console/command/reparser/reparse.php
index 8352c523de..151e196358 100644
--- a/phpBB/phpbb/console/command/reparser/reparse.php
+++ b/phpBB/phpbb/console/command/reparser/reparse.php
@@ -130,12 +130,19 @@ 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');
- $min = $input->getOption('range-min');
- $size = $input->getOption('range-size');
- $dry_run = $input->getOption('dry-run');
+ $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');
if ($max === 0)
{
@@ -183,7 +190,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, $dry_run);
+ $reparser->reparse_range($start, $end);
$current = $start - 1;
$progress->setProgress($max + 1 - $start);