Page MenuHomePhabricator

ApiQuerySiteinfo.php.patch

Authored By
bzimport
Nov 21 2014, 10:44 PM
Size
1 KB
Referenced Files
None
Subscribers
None

ApiQuerySiteinfo.php.patch

Index: ApiQuerySiteinfo.php
===================================================================
--- ApiQuerySiteinfo.php (revision 53800)
+++ ApiQuerySiteinfo.php (working copy)
@@ -71,6 +71,9 @@
case 'statistics':
$fit = $this->appendStatistics( $p );
break;
+ case 'configsettings':
+ $fit = $this->appendConfigSettings( $p );
+ break;
case 'usergroups':
$fit = $this->appendUserGroups( $p, $params['numberingroup'] );
break;
@@ -316,6 +319,17 @@
return $this->getResult()->addValue( 'query', $property, $data );
}
+ protected function appendConfigSettings( $property ) {
+ global $wgRateLimits, $wgRCMaxAge, $wgRightsIcon, $wgVersion;
+ $data = array();
+ $data['wgRateLimits'] = $wgRateLimits;
+ $data['wgRCMaxAge'] = $wgRCMaxAge;
+ $data['wgRightsIcon'] = $wgRightsIcon;
+ $data['wgVersion'] = $wgVersion;
+ return $this->getResult()->addValue( 'query', $property, $data );
+ }
+
+
protected function appendUserGroups( $property, $numberInGroup ) {
global $wgGroupPermissions;
$data = array();
@@ -423,6 +437,7 @@
'interwikimap',
'dbrepllag',
'statistics',
+ 'configsettings',
'usergroups',
'extensions',
'fileextensions',
@@ -451,6 +466,7 @@
' specialpagealiases - List of special page aliases',
' magicwords - List of magic words and their aliases',
' statistics - Returns site statistics',
+ ' configsettings - Returns configuration settings relevant to the API',
' interwikimap - Returns interwiki map (optionally filtered)',
' dbrepllag - Returns database server with the highest replication lag',
' usergroups - Returns user groups and the associated permissions',

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5459
Default Alt Text
ApiQuerySiteinfo.php.patch (1 KB)

Event Timeline