r50126 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r50125 | r50126 (on ViewVC) | r50127 >
Date:13:35, 2 May 2009
Author:catrope
Status:ok (Comments)
Tags:api 
Comment:API: Add PHP and database version to meta=siteinfo output
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/api/ApiQuerySiteinfo.php
===================================================================
--- trunk/phase3/includes/api/ApiQuerySiteinfo.php	(revision 50125)
+++ trunk/phase3/includes/api/ApiQuerySiteinfo.php	(revision 50126)
@@ -108,6 +108,10 @@
 		$data['base'] = $mainPage->getFullUrl();
 		$data['sitename'] = $GLOBALS['wgSitename'];
 		$data['generator'] = "MediaWiki {$GLOBALS['wgVersion']}";
+		$data['phpversion'] = phpversion();
+		$data['phpsapi'] = php_sapi_name();
+		$data['dbclass'] = get_class($this->getDB());
+		$data['dbversion'] = $this->getDB()->getServerVersion();
 
 		$svn = SpecialVersion::getSvnRevision( $GLOBALS['IP'] );
 		if( $svn )
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 50125)
+++ trunk/phase3/RELEASE-NOTES	(revision 50126)
@@ -126,6 +126,7 @@
 * (bug 18597) Internal error with empty generator= parameter
 * (bug 16422) Don't display help for format=jsonfm unless specifically requested
 * (bug 18617) Add xml:space="preserve" attribute to relevant tags in XML output
+* Added PHP and database version to meta=siteinfo output
 
 === Languages updated in 1.16 ===
 

Follow-up revisions

RevisionCommit summaryAuthorDate
r50161Fix up r50126: dump $wgDBtype rather than a class name, per CR commentcatrope07:00, 4 May 2009

Comments

#Comment by Brion VIBBER (Talk | contribs)   22:59, 3 May 2009

Dumping the class name for the database type doesn't strike me as ideal; that's an internal implementation detail and could change without the backend database changing in any way. I'd probably recommend using $wgDBtype here rather than a raw class name.

#Comment by Catrope (Talk | contribs)   07:01, 4 May 2009

Done in r50161

#Comment by Brion VIBBER (Talk | contribs)   22:34, 5 May 2009

Thanks!

Status & tagging log

Views
Toolbox