Remove unused global $IP
[lhc/web/wiklou.git] / maintenance / updaters.inc
index 246d6d6..7efe3a6 100644 (file)
@@ -270,7 +270,6 @@ function do_watchlist_update() {
 
 function do_copy_newtalk_to_watchlist() {
        global $wgDatabase;
-       global $wgCommandLineMode; # this needs to be saved while getID() and getName() are called
 
        $res = $wgDatabase->safeQuery( 'SELECT user_id, user_ip FROM !',
                $wgDatabase->tableName( 'user_newtalk' ) );
@@ -761,7 +760,7 @@ function do_page_random_update() {
 }
 
 function do_templatelinks_update() {
-       global $wgDatabase, $wgLoadBalancer;
+       global $wgDatabase;
        $fname = 'do_templatelinks_update';
 
        if ( $wgDatabase->tableExists( 'templatelinks' ) ) {
@@ -771,7 +770,7 @@ function do_templatelinks_update() {
        wfOut( "Creating templatelinks table...\n" );
        $wgDatabase->sourceFile( archive( 'patch-templatelinks.sql' ) );
        wfOut( "Populating...\n" );
-       if ( isset( $wgLoadBalancer ) && $wgLoadBalancer->getServerCount() > 1 ) {
+       if ( wfGetLB()->getServerCount() > 1 ) {
                // Slow, replication-friendly update
                $res = $wgDatabase->select( 'pagelinks', array( 'pl_from', 'pl_namespace', 'pl_title' ),
                        array( 'pl_namespace' => NS_TEMPLATE ), $fname );
@@ -937,7 +936,7 @@ function purge_cache() {
 }
 
 function do_all_updates( $shared = false, $purge = true ) {
-       global $wgNewTables, $wgExtModifiedFields, $wgNewFields, $wgRenamedTables, $wgSharedDB, $wgSharedTables, $wgDatabase, $wgDBtype, $IP;
+       global $wgSharedDB, $wgSharedTables, $wgDatabase, $wgDBtype;
 
        wfRunHooks( 'LoadExtensionSchemaUpdates' );
 
@@ -948,7 +947,6 @@ function do_all_updates( $shared = false, $purge = true ) {
                return;
        }
 
-       global $wgDatabase;
        $up = DatabaseUpdater::newForDb( $wgDatabase );
        $up->doUpdates();
 
@@ -1130,7 +1128,6 @@ function do_unique_pl_tl_il() {
 }
 
 function do_log_search_population() {
-       global $wgDatabase;
        if ( update_row_exists( 'populate log_search' ) ) {
                wfOut( "...log_search table already populated.\n" );
                return;
@@ -1308,7 +1305,7 @@ END;
 }
 
 function do_postgres_updates() {
-       global $wgDatabase, $wgVersion, $wgDBmwschema, $wgDBts2schema, $wgShowExceptionDetails, $wgDBuser;
+       global $wgDatabase, $wgDBmwschema, $wgDBts2schema, $wgShowExceptionDetails, $wgDBuser;
 
        # # Gather version numbers in case we need them
        $version = $wgDatabase->getServerVersion(); # # long string
@@ -1508,6 +1505,7 @@ function do_postgres_updates() {
                array( "watchlist",     "wl_user",            "(wl_user)" ),
                array( "logging",       "logging_user_type_time", "(log_user, log_type, log_timestamp)" ),
                array( "logging",       "logging_page_id_time",   "(log_page,log_timestamp)" ),
+               array( "iwlinks",       "iwl_prefix_title_from",  "(iwl_prefix, iwl_title, iwl_from)" ),
        );
 
        $newrules = array(