From 0c0cb97d70d282775c6331aeae4d000548e77300 Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 8 Jun 2012 09:43:45 +0200 Subject: [PATCH] generate links and other secondary data for RefreshLinks via ContentHandler --- includes/job/RefreshLinksJob.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/job/RefreshLinksJob.php b/includes/job/RefreshLinksJob.php index fa3a607840..05adec0246 100644 --- a/includes/job/RefreshLinksJob.php +++ b/includes/job/RefreshLinksJob.php @@ -58,11 +58,12 @@ class RefreshLinksJob extends Job { wfProfileIn( __METHOD__.'-parse' ); $options = ParserOptions::newFromUserAndLang( new User, $wgContLang ); - $parserOutput = $wgParser->parse( $revision->getText(), $this->title, $options, true, true, $revision->getId() ); #FIXME: content + $content = $revision->getContent(); + $parserOutput = $content->getParserOutput( $this->title, $revision->getId(), $options, false ); wfProfileOut( __METHOD__.'-parse' ); wfProfileIn( __METHOD__.'-update' ); - $updates = $parserOutput->getSecondaryDataUpdates( $this->title, false ); #FIXME: content handler + $updates = $content->getContentHandler()->getSecondaryDataUpdates( $content, $this->title, null, false, $parserOutput ); DataUpdate::runUpdates( $updates ); wfProfileOut( __METHOD__.'-update' ); @@ -132,11 +133,13 @@ class RefreshLinksJob2 extends Job { return false; } wfProfileIn( __METHOD__.'-parse' ); - $parserOutput = $wgParser->parse( $revision->getText(), $title, $options, true, true, $revision->getId() ); #FIXME: content handler + $options = ParserOptions::newFromUserAndLang( new User, $wgContLang ); + $content = $revision->getContent(); + $parserOutput = $content->getParserOutput( $title, $revision->getId(), $options, false ); wfProfileOut( __METHOD__.'-parse' ); wfProfileIn( __METHOD__.'-update' ); - $updates = $parserOutput->getSecondaryDataUpdates( $title, false ); #FIXME: content handler + $updates = $content->getContentHandler()->getSecondaryDataUpdates( $content, $title, null, false, $parserOutput ); DataUpdate::runUpdates( $updates ); wfProfileOut( __METHOD__.'-update' ); -- 2.20.1