r32981 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32980‎ | r32981 | r32982 >
Date:20:24, 8 April 2008
Author:ialex
Status:old
Tags:
Comment:
Don't use $wgDBservers to get server ip, it isn't set on Wikimedia and return host="" for all db servers
Modified paths:
  • /trunk/phase3/includes/api/ApiQuerySiteinfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
@@ -195,12 +195,12 @@
196196 if ($includeAll) {
197197 if (!$wgShowHostnames)
198198 $this->dieUsage('Cannot view all servers info unless $wgShowHostnames is true', 'includeAllDenied');
199 -
200 - global $wgDBservers;
201 - $lags = wfGetLB()->getLagTimes();
 199+
 200+ $lb = wfGetLB();
 201+ $lags = $lb->getLagTimes();
202202 foreach( $lags as $i => $lag ) {
203203 $data[] = array (
204 - 'host' => $wgDBservers[$i]['host'],
 204+ 'host' => $lb->getServerName( $i ),
205205 'lag' => $lag);
206206 }
207207 } else {

Status & tagging log