$options = new ParserOptions;
$parserOutput = $wgParser->parse( $revision->getText(), $this->title, $options, true, true, $revision->getId() );
- $update = new LinksUpdate( $this->title, $parserOutput );
+ $update = new LinksUpdate( $this->title, $parserOutput, false );
$update->doUpdate();
return true;
}
$mExternals, # URLs of external links, array key only
$mCategories, # Map of category names to sort keys
$mDb, # Database connection reference
- $mOptions; # SELECT options to be used (array)
+ $mOptions, # SELECT options to be used (array)
+ $mRecursive; # Whether to queue jobs for recursive updates
/**#@-*/
/**
* @param integer $id
* @param string $title
*/
- function LinksUpdate( $title, $parserOutput ) {
+ function LinksUpdate( $title, $parserOutput, $recursive = true ) {
global $wgAntiLockFlags;
if ( $wgAntiLockFlags & ALF_NO_LINK_LOCK ) {
$this->mTemplates = $parserOutput->getTemplates();
$this->mExternals = $parserOutput->getExternalLinks();
$this->mCategories = $parserOutput->getCategories();
+ $this->mRecursive = $recursive;
}
$this->getTemplateInsertions( $existing ) );
# Refresh links of all pages including this page
- $tlto = $this->mTitle->getTemplateLinksTo();
- if ( count( $tlto ) ) {
- require_once( 'JobQueue.php' );
- Job::queueLinksJobs( $tlto );
+ if ( $this->mRecursive ) {
+ $tlto = $this->mTitle->getTemplateLinksTo();
+ if ( count( $tlto ) ) {
+ require_once( 'JobQueue.php' );
+ Job::queueLinksJobs( $tlto );
+ }
}
# Category links
$categoryUpdates = array_diff_assoc( $existing, $this->mCategories ) + array_diff_assoc( $this->mCategories, $existing );
# Refresh links of all pages including this page
- $tlto = $this->mTitle->getTemplateLinksTo();
- if ( count( $tlto ) ) {
- require_once( 'JobQueue.php' );
- Job::queueLinksJobs( $tlto );
+ if ( $this->mRecursive ) {
+ $tlto = $this->mTitle->getTemplateLinksTo();
+ if ( count( $tlto ) ) {
+ require_once( 'JobQueue.php' );
+ Job::queueLinksJobs( $tlto );
+ }
}
$this->dumbTableUpdate( 'pagelinks', $this->getLinkInsertions(), 'pl_from' );