From 1a951ec9cd2bb22f7015ba3290f10360c22867dc Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 20 Mar 2011 13:31:22 +0000 Subject: [PATCH] Addition of 'APIQuerySiteInfoGeneralInfo' hook for usage in bug 16288 "API: consider making closure status of wikis more clear with meta=siteinfo" --- RELEASE-NOTES | 2 ++ docs/hooks.txt | 5 +++++ includes/api/ApiQuerySiteinfo.php | 2 ++ 3 files changed, 9 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 78c8d67c24..3d05272a7e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -271,6 +271,8 @@ PHP if you have not done so prior to upgrading MediaWiki. * (bug 27343) Add parseddescription to list=filearchive * (bug 27469) label implicit groups in list=allusers&auprop=groups/ list=users&usprop=groups +* Addition of APIQuerySiteInfoGeneralInfo hook to add extra information to + the general site info results === Languages updated in 1.18 === diff --git a/docs/hooks.txt b/docs/hooks.txt index a30bf9f52b..7a68a640c0 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -354,6 +354,11 @@ associated RecentChange object. In the hook, just add your callback to the $tokenFunctions array and return true (returning false makes no sense) $tokenFunctions: array(action => callback) +'APIQuerySiteInfoGeneralInfo': use this hook to add extra information to +the sites general information. +$module: the current ApiQuerySiteInfo module +$resutls: 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 diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index 651e0135be..06e1a71ca3 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -160,6 +160,8 @@ class ApiQuerySiteinfo extends ApiQueryBase { $data['wikiid'] = wfWikiID(); $data['time'] = wfTimestamp( TS_ISO_8601, time() ); + wfRunHooks( 'APIQuerySiteInfoGeneralInfo', array( &$this, &$data ) ); + return $this->getResult()->addValue( 'query', $property, $data ); } -- 2.20.1