(bug 9440) Added "mediawikiwiki" interwiki prefix to MediaWiki.org
[lhc/web/wiklou.git] / maintenance / refreshLinks.inc
index fa3c9e6..7a560e9 100644 (file)
@@ -1,8 +1,7 @@
 <?php
 /**
  * @todo document
- * @package MediaWiki
- * @subpackage Maintenance
+ * @addtogroup Maintenance
  */
 
 /** */
@@ -13,8 +12,7 @@ function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0 ) {
        global $wgUser, $wgParser, $wgUseImageResize, $wgUseTidy;
 
        $fname = 'refreshLinks';
-       $dbr =& wfGetDB( DB_SLAVE );
-       $dbw =& wfGetDB( DB_MASTER );
+       $dbr = wfGetDB( DB_SLAVE );
        $start = intval( $start );
 
        # Don't generate TeX PNGs (lack of a sensible current directory causes errors anyway)
@@ -63,16 +61,14 @@ function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0 ) {
                        }
                        fixLinksFromArticle( $id );
                }
-
-
        }
 }
 
 function fixLinksFromArticle( $id ) {
-       global $wgTitle, $wgArticle, $wgOut, $wgParser;
+       global $wgTitle, $wgParser;
        
        $wgTitle = Title::newFromID( $id );
-       $dbw =& wfGetDB( DB_MASTER );
+       $dbw = wfGetDB( DB_MASTER );
 
        $linkCache =& LinkCache::singleton();
        $linkCache->clear();
@@ -89,7 +85,7 @@ function fixLinksFromArticle( $id ) {
 
        $options = new ParserOptions;
        $parserOutput = $wgParser->parse( $revision->getText(), $wgTitle, $options, true, true, $revision->getId() );
-       $update = new LinksUpdate( $wgTitle, $parserOutput );
+       $update = new LinksUpdate( $wgTitle, $parserOutput, false );
        $update->doUpdate();
        $dbw->immediateCommit();
 }
@@ -99,7 +95,7 @@ function deleteLinksFromNonexistent( $maxLag = 0 ) {
 
        wfWaitForSlaves( $maxLag );
 
-       $dbw =& wfGetDB( DB_WRITE );
+       $dbw = wfGetDB( DB_WRITE );
 
        $linksTables = array(
                'pagelinks' => 'pl_from',