jenkins-bot has submitted this change and it was merged.
Change subject: Add APIQuerySiteInfoStatisticsInfo hook
......................................................................
Add APIQuerySiteInfoStatisticsInfo hook
Allows extensions to modify the output of
action=query&meta=siteinfo&siprop=statstics
Accompanies the SpecialStatsAddExtra hook for Special:Statistics
Change-Id: I712748077a0ac2fb729bfe3b6616ac4981cb754e
---
M RELEASE-NOTES-1.22
M docs/hooks.txt
M includes/api/ApiQuerySiteinfo.php
3 files changed, 9 insertions(+), 0 deletions(-)
Approvals:
Anomie: Looks good to me, approved
Nikerabbit: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22
index a365da6..a6b31b5 100644
--- a/RELEASE-NOTES-1.22
+++ b/RELEASE-NOTES-1.22
@@ -240,6 +240,8 @@
* ResourceLoader supports hashes as module cache invalidation trigger (instead
of or in addition to timestamps).
* Added $wgExtensionEntryPointListFiles for use in mergeMessageFileList.php.
+* Added a hook, APIQuerySiteInfoStatisticsInfo, to allow extensions to modify
+ the output of the API query meta=siteinfo&siprop=statistics
=== Bug fixes in 1.22 ===
* Disable Special:PasswordReset when $wgEnableEmail is false. Previously one
diff --git a/docs/hooks.txt b/docs/hooks.txt
index 2d1001b..53993de 100644
--- a/docs/hooks.txt
+++ b/docs/hooks.txt
@@ -432,6 +432,10 @@
$module: the current ApiQuerySiteInfo module
&$results: array of results, add things here
+'APIQuerySiteInfoStatisticsInfo': Use this hook to add extra information to the
+sites statistics information.
+&$results: array of results, add things here
+
'APIQueryUsersTokens': Use this hook to add custom token to list=users. Every
token has an action, which will be used in the ustoken parameter and in the
output (actiontoken="..."), and a callback function which should return the
diff --git a/includes/api/ApiQuerySiteinfo.php
b/includes/api/ApiQuerySiteinfo.php
index 6aa311e..a776706 100644
--- a/includes/api/ApiQuerySiteinfo.php
+++ b/includes/api/ApiQuerySiteinfo.php
@@ -421,6 +421,9 @@
$data['activeusers'] = intval( SiteStats::activeUsers() );
$data['admins'] = intval( SiteStats::numberingroup( 'sysop' ) );
$data['jobs'] = intval( SiteStats::jobs() );
+
+ wfRunHooks( 'APIQuerySiteInfoStatisticsInfo', array( &$data ) );
+
return $this->getResult()->addValue( 'query', $property, $data
);
}
--
To view, visit https://gerrit.wikimedia.org/r/87692
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I712748077a0ac2fb729bfe3b6616ac4981cb754e
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits