aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/console/command/reparser/reparse.php31
-rw-r--r--phpBB/phpbb/cron/task/text_reparser/reparser.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v320/text_reparser.php10
-rw-r--r--phpBB/phpbb/textreparser/manager.php4
4 files changed, 22 insertions, 25 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)
{
diff --git a/phpBB/phpbb/cron/task/text_reparser/reparser.php b/phpBB/phpbb/cron/task/text_reparser/reparser.php
index 9ce886a6d9..aa644de827 100644
--- a/phpBB/phpbb/cron/task/text_reparser/reparser.php
+++ b/phpBB/phpbb/cron/task/text_reparser/reparser.php
@@ -122,7 +122,7 @@ class reparser extends \phpbb\cron\task\base
}
}
- if ($this->config[$this->reparser_name . '_cron_interval'] != -1)
+ if ($this->config[$this->reparser_name . '_cron_interval'])
{
return $this->config[$this->reparser_name . '_last_cron'] < time() - $this->config[$this->reparser_name . '_cron_interval'];
}
diff --git a/phpBB/phpbb/db/migration/data/v320/text_reparser.php b/phpBB/phpbb/db/migration/data/v320/text_reparser.php
index 0d8fd2ebb5..1d73b74a76 100644
--- a/phpBB/phpbb/db/migration/data/v320/text_reparser.php
+++ b/phpBB/phpbb/db/migration/data/v320/text_reparser.php
@@ -29,15 +29,15 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration
{
return array(
array('config.add', array('reparse_lock', 0, true)),
- array('config.add', array('text_reparser.pm_text_cron_interval', 0)),
+ array('config.add', array('text_reparser.pm_text_cron_interval', 10)),
array('config.add', array('text_reparser.pm_text_last_cron', 0)),
- array('config.add', array('text_reparser.poll_option_cron_interval', 0)),
+ array('config.add', array('text_reparser.poll_option_cron_interval', 10)),
array('config.add', array('text_reparser.poll_option_last_cron', 0)),
- array('config.add', array('text_reparser.poll_title_cron_interval', 0)),
+ array('config.add', array('text_reparser.poll_title_cron_interval', 10)),
array('config.add', array('text_reparser.poll_title_last_cron', 0)),
- array('config.add', array('text_reparser.post_text_cron_interval', 0)),
+ array('config.add', array('text_reparser.post_text_cron_interval', 10)),
array('config.add', array('text_reparser.post_text_last_cron', 0)),
- array('config.add', array('text_reparser.user_signature_cron_interval', 0)),
+ array('config.add', array('text_reparser.user_signature_cron_interval', 10)),
array('config.add', array('text_reparser.user_signature_last_cron', 0)),
array('custom', array(array($this, 'reparse'))),
);
diff --git a/phpBB/phpbb/textreparser/manager.php b/phpBB/phpbb/textreparser/manager.php
index 8e997f60ef..fddd867923 100644
--- a/phpBB/phpbb/textreparser/manager.php
+++ b/phpBB/phpbb/textreparser/manager.php
@@ -100,7 +100,7 @@ class manager
* Sets the interval for a text_reparser cron task
*
* @param string $name Name of the reparser to schedule
- * @param int $interval Interval in seconds, -1 to disable the cron task
+ * @param int $interval Interval in seconds, 0 to disable the cron task
*/
public function schedule($name, $interval)
{
@@ -113,7 +113,7 @@ class manager
/**
* Sets the interval for all text_reparser cron tasks
*
- * @param int $interval Interval in seconds, -1 to disable the cron task
+ * @param int $interval Interval in seconds, 0 to disable the cron task
*/
public function schedule_all($interval)
{