From c536e3db658bb8330b02e2aa3da1b982646d8964 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 17 Apr 2012 17:54:00 +0200 Subject: [PATCH] use ParserOutput::getSecondaryDataUpdates() as the primary method of getting pending updates --- includes/WikiPage.php | 2 +- includes/api/ApiPurge.php | 2 +- includes/job/RefreshLinksJob.php | 4 ++-- includes/parser/ParserOutput.php | 19 +++---------------- maintenance/refreshLinks.php | 2 +- 5 files changed, 8 insertions(+), 21 deletions(-) diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 46385464ae..dac63c9b59 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -1742,7 +1742,7 @@ class WikiPage extends Page { } # Update the links tables and other secondary data - $updates = $editInfo->output->getLinksUpdateAndOtherUpdates( $this->mTitle ); + $updates = $editInfo->output->getSecondaryDataUpdates( $this->mTitle ); SecondaryDataUpdate::runUpdates( $updates ); wfRunHooks( 'ArticleEditUpdates', array( &$this, &$editInfo, $options['changed'] ) ); diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index 77898cf72d..0f7315f6b3 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -93,7 +93,7 @@ class ApiPurge extends ApiBase { true, true, $page->getLatest() ); #FIXME: content! # Update the links tables - $updates = $p_result->getLinksUpdateAndOtherUpdates( $title ); + $updates = $p_result->getSecondaryDataUpdates( $title ); SecondaryDataUpdate::runUpdates( $updates ); $r['linkupdate'] = ''; diff --git a/includes/job/RefreshLinksJob.php b/includes/job/RefreshLinksJob.php index dcc5ab107c..c4efcabfb5 100644 --- a/includes/job/RefreshLinksJob.php +++ b/includes/job/RefreshLinksJob.php @@ -47,7 +47,7 @@ class RefreshLinksJob extends Job { wfProfileOut( __METHOD__.'-parse' ); wfProfileIn( __METHOD__.'-update' ); - $updates = $parserOutput->getLinksUpdateAndOtherUpdates( $this->title, false ); + $updates = $parserOutput->getSecondaryDataUpdates( $this->title, false ); SecondaryDataUpdate::runUpdates( $updates ); wfProfileOut( __METHOD__.'-update' ); @@ -121,7 +121,7 @@ class RefreshLinksJob2 extends Job { wfProfileOut( __METHOD__.'-parse' ); wfProfileIn( __METHOD__.'-update' ); - $updates = $parserOutput->getLinksUpdateAndOtherUpdates( $title, false ); + $updates = $parserOutput->getSecondaryDataUpdates( $title, false ); SecondaryDataUpdate::runUpdates( $updates ); wfProfileOut( __METHOD__.'-update' ); diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 9cb247f69b..5304974b7f 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -463,28 +463,15 @@ class ParserOutput extends CacheTime { /** * Returns any SecondaryDataUpdate jobs to be executed in order to store secondary information - * extracted from the page's content. - * - * This does not automatically include an LinksUpdate object for the links in this ParserOutput instance. - * Use getLinksUpdateAndOtherUpdates() if you want that. - * - * @return array an array of instances of SecondaryDataUpdate - */ - public function getSecondaryDataUpdates() { - return $this->mSecondaryDataUpdates; - } - - /** - * Conveniance method that returns any SecondaryDataUpdate jobs to be executed in order - * to store secondary information extracted from the page's content, including the LinksUpdate object - * for all links stopred in this ParserOutput object. + * extracted from the page's content, includingt a LinksUpdate object for all links stopred in + * this ParserOutput object. * * @param $title Title of the page we're updating. If not given, a title object will be created based on $this->getTitleText() * @param $recursive Boolean: queue jobs for recursive updates? * * @return array an array of instances of SecondaryDataUpdate */ - public function getLinksUpdateAndOtherUpdates( Title $title = null, $recursive = true ) { + public function getSecondaryDataUpdates( Title $title = null, $recursive = true ) { if ( empty( $title ) ) { $title = Title::newFromText( $this->getTitleText() ); } diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php index dd8c8a71f5..4372502522 100644 --- a/maintenance/refreshLinks.php +++ b/maintenance/refreshLinks.php @@ -222,7 +222,7 @@ class RefreshLinks extends Maintenance { $options = new ParserOptions; $parserOutput = $wgParser->parse( $revision->getText(), $title, $options, true, true, $revision->getId() ); - $updates = $parserOutput->getLinksUpdateAndOtherUpdates( $title, false ); + $updates = $parserOutput->getSecondaryDataUpdates( $title, false ); SecondaryDataUpdate::runUpdates( $updates ); $dbw->commit(); -- 2.20.1