Fix description
[lhc/web/wiklou.git] / maintenance / updateSpecialPages.php
index c7f9749..94b5f20 100644 (file)
@@ -5,14 +5,15 @@ $options = array('only','help');
 
 require_once( 'commandLine.inc' );
 
-require_once( 'SpecialPage.php' );
-require_once( 'QueryPage.php' );
+require_once( "$IP/includes/SpecialPage.php" );
+require_once( "$IP/includes/QueryPage.php" );
 
 if(@$options['help']) {
        print "usage:updateSpecialPages.php [--help] [--only=page]\n";
        print "  --help      : this help message\n";
        print "  --list      : list special pages names\n";
        print "  --only=page : only update 'page'. Ex: --only=BrokenRedirects\n";
+       print "  --override  : update even pages which have had updates disabled\n";
        wfDie();
 }
 
@@ -28,7 +29,7 @@ foreach ( $wgQueryPages as $page ) {
                continue;
        }
 
-       if ( $wgDisableQueryPageUpdate && in_array( $special, $wgDisableQueryPageUpdate ) ) {
+       if ( !isset( $options['override'] ) && $wgDisableQueryPageUpdate && in_array( $special, $wgDisableQueryPageUpdate ) ) {
                printf("%-30s disabled\n", $special);
                continue;
        }
@@ -72,12 +73,12 @@ foreach ( $wgQueryPages as $page ) {
                }
 
                # Reopen any connections that have closed
-               if ( !$wgLoadBalancer->pingAll())  {
+               if ( !wfGetLB()->pingAll())  {
                        print "\n";
                        do {
                                print "Connection failed, reconnecting in 10 seconds...\n";
                                sleep(10);
-                       } while ( !$wgLoadBalancer->pingAll() );
+                       } while ( !wfGetLB()->pingAll() );
                        print "Reconnected\n\n";
                } else {
                        # Commit the results
@@ -101,4 +102,4 @@ foreach ( $wgQueryPages as $page ) {
        }
 }
 
-?>
+