/**
* Job to update links for a given title.
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
* @file
* @ingroup JobQueue
*/
* @return boolean success
*/
function run() {
- global $wgParser;
+ global $wgParser, $wgContLang;
wfProfileIn( __METHOD__ );
$linkCache = LinkCache::singleton();
}
wfProfileIn( __METHOD__.'-parse' );
- $options = new ParserOptions;
- $parserOutput = $wgParser->parse( $revision->getText(), $this->title, $options, true, true, $revision->getId() );
+ $options = ParserOptions::newFromUserAndLang( new User, $wgContLang );
+ $parserOutput = $wgParser->parse( $revision->getText(), $this->title, $options, true, true, $revision->getId() ); #FIXME: content
wfProfileOut( __METHOD__.'-parse' );
wfProfileIn( __METHOD__.'-update' );
- $update = new LinksUpdate( $this->title, $parserOutput, false );
- $update->doUpdate();
+
+ $updates = $parserOutput->getSecondaryDataUpdates( $this->title, false ); #FIXME: content handler
+ DataUpdate::runUpdates( $updates );
+
wfProfileOut( __METHOD__.'-update' );
wfProfileOut( __METHOD__ );
return true;
* @return boolean success
*/
function run() {
- global $wgParser;
+ global $wgParser, $wgContLang;
wfProfileIn( __METHOD__ );
wfProfileOut( __METHOD__ );
return false;
}
+ // Back compat for pre-r94435 jobs
+ $table = isset( $this->params['table'] ) ? $this->params['table'] : 'templatelinks';
$titles = $this->title->getBacklinkCache()->getLinks(
- 'templatelinks', $this->params['start'], $this->params['end']);
+ $table, $this->params['start'], $this->params['end']);
# Not suitable for page load triggered job running!
# Gracefully switch to refreshLinks jobs if this happens.
wfProfileOut( __METHOD__ );
return true;
}
+ $options = ParserOptions::newFromUserAndLang( new User, $wgContLang );
# Re-parse each page that transcludes this page and update their tracking links...
foreach ( $titles as $title ) {
$revision = Revision::newFromTitle( $title );
return false;
}
wfProfileIn( __METHOD__.'-parse' );
- $options = new ParserOptions;
- $parserOutput = $wgParser->parse( $revision->getText(), $title, $options, true, true, $revision->getId() );
+ $parserOutput = $wgParser->parse( $revision->getText(), $title, $options, true, true, $revision->getId() ); #FIXME: content handler
wfProfileOut( __METHOD__.'-parse' );
wfProfileIn( __METHOD__.'-update' );
- $update = new LinksUpdate( $title, $parserOutput, false );
- $update->doUpdate();
+
+ $updates = $parserOutput->getSecondaryDataUpdates( $title, false ); #FIXME: content handler
+ DataUpdate::runUpdates( $updates );
+
wfProfileOut( __METHOD__.'-update' );
- wfWaitForSlaves( 5 );
+ wfWaitForSlaves();
}
wfProfileOut( __METHOD__ );