From: Alexandre Emsenhuber Date: Fri, 7 Aug 2009 14:05:26 +0000 (+0000) Subject: * update identation X-Git-Tag: 1.31.0-rc.0~40439 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=9898872283b9fdadf28a9e92618e22f22d9dd56d;p=lhc%2Fweb%2Fwiklou.git * update identation * added missing "global $wgQueryCacheLimit" * require QueryPage.php to set $wgQueryPages correctly before using it --- diff --git a/maintenance/updateSpecialPages.php b/maintenance/updateSpecialPages.php index ff9a618dcf..d66396711e 100644 --- a/maintenance/updateSpecialPages.php +++ b/maintenance/updateSpecialPages.php @@ -32,7 +32,7 @@ class UpdateSpecialPages extends Maintenance { } public function execute() { - global $wgOut, $wgSpecialPageCacheUpdates, $wgQueryPages; + global $IP, $wgOut, $wgSpecialPageCacheUpdates, $wgQueryPages, $wgQueryCacheLimit; $wgOut->disable(); $dbw = wfGetDB( DB_MASTER ); @@ -60,6 +60,9 @@ class UpdateSpecialPages extends Maintenance { wfWaitForSlaves( 5 ); } + // This is needed to initialise $wgQueryPages + require_once( "$IP/includes/QueryPage.php" ); + foreach( $wgQueryPages as $page ) { @list( $class, $special, $limit ) = $page; @@ -108,21 +111,21 @@ class UpdateSpecialPages extends Maintenance { $this->output( $minutes . 'm ' ); } $this->output( sprintf( "%.2fs\n", $seconds ) ); - } - # Reopen any connections that have closed - if ( !wfGetLB()->pingAll()) { - $this->output( "\n" ); - do { - $this->error( "Connection failed, reconnecting in 10 seconds..." ); - sleep(10); - } while ( !wfGetLB()->pingAll() ); - $this->output( "Reconnected\n\n" ); - } else { - # Commit the results - $dbw->immediateCommit(); - } - # Wait for the slave to catch up - wfWaitForSlaves( 5 ); + } + # Reopen any connections that have closed + if ( !wfGetLB()->pingAll()) { + $this->output( "\n" ); + do { + $this->error( "Connection failed, reconnecting in 10 seconds..." ); + sleep( 10 ); + } while ( !wfGetLB()->pingAll() ); + $this->output( "Reconnected\n\n" ); + } else { + # Commit the results + $dbw->immediateCommit(); + } + # Wait for the slave to catch up + wfWaitForSlaves( 5 ); } else { $this->output( "cheap, skipped\n" ); }