diff options
author | Marc Alexander <admin@m-a-styles.de> | 2016-12-18 19:33:42 +0100 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2016-12-18 19:33:42 +0100 |
commit | fd19ef7598a5d84485f4864bfcac36beef959a7c (patch) | |
tree | aeabd554b44448eb0555209da45543b1312c8c04 /phpBB/phpbb/console/command | |
parent | f84c3687cce0e4dc1868016c14e416047013d784 (diff) | |
parent | 76e9f4dd2d45e8f128e59e1378dfd6778eec9d48 (diff) | |
download | forums-fd19ef7598a5d84485f4864bfcac36beef959a7c.tar forums-fd19ef7598a5d84485f4864bfcac36beef959a7c.tar.gz forums-fd19ef7598a5d84485f4864bfcac36beef959a7c.tar.bz2 forums-fd19ef7598a5d84485f4864bfcac36beef959a7c.tar.xz forums-fd19ef7598a5d84485f4864bfcac36beef959a7c.zip |
Merge pull request #4585 from VSEphpbb/ticket/14925
[ticket/14925] Set reparser names in service definitions
Diffstat (limited to 'phpBB/phpbb/console/command')
-rw-r--r-- | phpBB/phpbb/console/command/reparser/list_all.php | 4 | ||||
-rw-r--r-- | phpBB/phpbb/console/command/reparser/reparse.php | 16 |
2 files changed, 8 insertions, 12 deletions
diff --git a/phpBB/phpbb/console/command/reparser/list_all.php b/phpBB/phpbb/console/command/reparser/list_all.php index 028468649d..a79578abf0 100644 --- a/phpBB/phpbb/console/command/reparser/list_all.php +++ b/phpBB/phpbb/console/command/reparser/list_all.php @@ -34,10 +34,10 @@ class list_all extends \phpbb\console\command\command { parent::__construct($user); $this->reparser_names = array(); - foreach ($reparsers as $name => $reparser) + foreach ($reparsers as $reparser) { // Store the names without the "text_reparser." prefix - $this->reparser_names[] = preg_replace('(^text_reparser\\.)', '', $name); + $this->reparser_names[] = $reparser->get_name(); } } diff --git a/phpBB/phpbb/console/command/reparser/reparse.php b/phpBB/phpbb/console/command/reparser/reparse.php index cebeee0919..f285977ea2 100644 --- a/phpBB/phpbb/console/command/reparser/reparse.php +++ b/phpBB/phpbb/console/command/reparser/reparse.php @@ -140,13 +140,9 @@ class reparse extends \phpbb\console\command\command } $name = $input->getArgument('reparser-name'); - if (isset($name)) + if ($name) { - // Allow "post_text" to be an alias for "text_reparser.post_text" - if (!isset($this->reparsers[$name])) - { - $name = 'text_reparser.' . $name; - } + $name = $this->reparser_manager->find_reparser($name); $this->reparse($name); } else @@ -187,7 +183,7 @@ class reparse extends \phpbb\console\command\command /** * Reparse all text handled by given reparser within given range * - * @param string $name Reparser name + * @param string $name Reparser service name */ protected function reparse($name) { @@ -218,10 +214,10 @@ class reparse extends \phpbb\console\command\command return; } - $this->io->section($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', preg_replace('(^text_reparser\\.)', '', $name), $min, $max)); + $this->io->section($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', $reparser->get_name(), $min, $max)); $progress = $this->create_progress_bar($max, $this->io, $this->output, true); - $progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING_START', preg_replace('(^text_reparser\\.)', '', $name))); + $progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING_START', $reparser->get_name())); $progress->start(); // Start from $max and decrement $current by $size until we reach $min @@ -231,7 +227,7 @@ class reparse extends \phpbb\console\command\command $start = max($min, $current + 1 - $size); $end = max($min, $current); - $progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', preg_replace('(^text_reparser\\.)', '', $name), $start, $end)); + $progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', $reparser->get_name(), $start, $end)); $reparser->reparse_range($start, $end); $current = $start - 1; |