1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[ticket/13987] Replaced optional parameter with explicit API

Added disable_save() and enable_save() to toggle a dry run

PHPBB3-13987
This commit is contained in:
JoshyPHP
2015-07-06 01:57:54 +02:00
parent 7ccb638912
commit cf4cdcda58
6 changed files with 49 additions and 18 deletions

View File

@@ -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);