bug 15849 - Trying to move a page onto an interwiki page produces an inappropriate...
[lhc/web/wiklou.git] / maintenance / updateSearchIndex.inc
index ed01575..0cac450 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
- * @package MediaWiki
- * @subpackage Maintenance
+ * @file
+ * @ingroup Maintenance
  */
 
 /** */
@@ -14,7 +14,7 @@ function updateSearchIndex( $start, $end, $maxLockTime, $quiet ) {
        $wgQuiet = $quiet;
        $wgDisableSearchUpdate = false;
 
-       $dbw =& wfGetDB( DB_MASTER );
+       $dbw = wfGetDB( DB_MASTER );
        $recentchanges = $dbw->tableName( 'recentchanges' );
 
        output( "Updating searchindex between $start and $end\n" );
@@ -74,7 +74,9 @@ function updateSearchIndex( $start, $end, $maxLockTime, $quiet ) {
 
        # Unlock searchindex
        if ( $maxLockTime ) {
+               output( "    --- Unlocking --" );
                unlockSearchindex( $dbw );
+               output( "\n" );
        }
        output( "Done\n" );
 }
@@ -91,11 +93,11 @@ function lockSearchindex( &$db ) {
                $items[] = $db->tableName( $table ) . ' READ';
        }
        $sql = "LOCK TABLES " . implode( ',', $items );
-       $db->query( $sql );
+       $db->query( $sql, 'updateSearchIndex.inc ' . __METHOD__ );
 }
 
 function unlockSearchindex( &$db ) {
-       $db->query( "UNLOCK TABLES" );
+       $db->query( "UNLOCK TABLES", 'updateSearchIndex.inc ' . __METHOD__ );
 }
 
 # Unlock and lock again
@@ -111,5 +113,3 @@ function output( $text ) {
                print $text;
        }
 }
-
-?>