From: Bertrand Grondin Date: Tue, 18 Mar 2008 07:58:21 +0000 (+0000) Subject: Fix bug when using Mediawiki Installer. X-Git-Tag: 1.31.0-rc.0~49031 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=fb825dea83357f8331ba8952102b884e7f5c3367;p=lhc%2Fweb%2Fwiklou.git Fix bug when using Mediawiki Installer. fix the following message error : Fatal error: Call to undefined function wfWaitForSlaves() in maintenance/populateCategory.inc on line 66 This wfWaitForSlaves() function exists only in commandLine.inc but updater can't call it when not using command line tool. Adding this function in the end of populateCategory.inc. --- diff --git a/maintenance/populateCategory.inc b/maintenance/populateCategory.inc index f17e5e827f..905706ed39 100644 --- a/maintenance/populateCategory.inc +++ b/maintenance/populateCategory.inc @@ -82,3 +82,19 @@ function populateCategory( $begin, $maxlag, $throttle, $force ) { return false; } } + +function wfWaitForSlaves( $maxLag ) { + global $wgLoadBalancer; + if ( $maxLag ) { + list( $host, $lag ) = $wgLoadBalancer->getMaxLag(); + while ( $lag > $maxLag ) { + $name = @gethostbyaddr( $host ); + if ( $name !== false ) { + $host = $name; + } + print "Waiting for $host (lagged $lag seconds)...\n"; + sleep($maxLag); + list( $host, $lag ) = $wgLoadBalancer->getMaxLag(); + } + } +}