aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/console
diff options
context:
space:
mode:
authorOliver Schramm <oliver.schramm97@gmail.com>2015-11-01 03:49:01 +0100
committerOliver Schramm <oliver.schramm97@gmail.com>2015-11-08 03:29:37 +0100
commit900ccd79af816d8d54e6974e9163d9999a823513 (patch)
tree6b44dded82945d3be6341ef84ec80bfe47fae1bf /phpBB/phpbb/console
parent081424a6c45eb05bad7b2b15a445c33d40fdc1a6 (diff)
downloadforums-900ccd79af816d8d54e6974e9163d9999a823513.tar
forums-900ccd79af816d8d54e6974e9163d9999a823513.tar.gz
forums-900ccd79af816d8d54e6974e9163d9999a823513.tar.bz2
forums-900ccd79af816d8d54e6974e9163d9999a823513.tar.xz
forums-900ccd79af816d8d54e6974e9163d9999a823513.zip
[ticket/14257] Fix CLI reparser and set cron interval
PHPBB3-14257
Diffstat (limited to 'phpBB/phpbb/console')
-rw-r--r--phpBB/phpbb/console/command/reparser/reparse.php31
1 files changed, 14 insertions, 17 deletions
diff --git a/phpBB/phpbb/console/command/reparser/reparse.php b/phpBB/phpbb/console/command/reparser/reparse.php
index 6137a79b89..ddc97a1d1d 100644
--- a/phpBB/phpbb/console/command/reparser/reparse.php
+++ b/phpBB/phpbb/console/command/reparser/reparse.php
@@ -53,7 +53,7 @@ class reparse extends \phpbb\console\command\command
protected $reparsers;
/**
- * @var array Reparser names as keys, and their last $current ID as values
+ * @var array The reparser's last $current ID as values
*/
protected $resume_data;
@@ -208,27 +208,18 @@ class reparse extends \phpbb\console\command\command
* Will use the last saved value if --resume is set and the option was not specified
* on the command line
*
- * @param string $reparser_name Reparser name
* @param string $option_name Option name
* @return integer
*/
- protected function get_option($reparser_name, $option_name)
+ protected function get_option($option_name)
{
// Return the option from the resume_data if applicable
- if ($this->input->getOption('resume') && isset($this->resume_data[$reparser_name][$option_name]) && !$this->input->hasParameterOption('--' . $option_name))
+ if ($this->input->getOption('resume') && isset($this->resume_data[$option_name]) && !$this->input->hasParameterOption('--' . $option_name))
{
- return $this->resume_data[$reparser_name][$option_name];
+ return $this->resume_data[$option_name];
}
- $value = $this->input->getOption($option_name);
-
- // range-max has no default value, it must be computed for each reparser
- if ($option_name === 'range-max' && $value === null)
- {
- $value = $this->reparsers[$reparser_name]->get_max_id();
- }
-
- return $value;
+ return $this->input->getOption($option_name);
}
/**
@@ -250,9 +241,15 @@ class reparse extends \phpbb\console\command\command
}
// Start at range-max if specified or at the highest ID otherwise
- $max = $this->get_option($name, 'range-max');
- $min = $this->get_option($name, 'range-min');
- $size = $this->get_option($name, 'range-size');
+ $max = $this->get_option('range-max');
+ $min = $this->get_option('range-min');
+ $size = $this->get_option('range-size');
+
+ // range-max has no default value, it must be computed for each reparser
+ if ($max == null)
+ {
+ $max = $reparser->get_max_id();
+ }
if ($max < $min)
{