From: Sam Reed Date: Sun, 20 Mar 2011 13:31:22 +0000 (+0000) Subject: Addition of 'APIQuerySiteInfoGeneralInfo' hook for usage in bug 16288 "API: consider... X-Git-Tag: 1.31.0-rc.0~31303 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=1a951ec9cd2bb22f7015ba3290f10360c22867dc;p=lhc%2Fweb%2Fwiklou.git Addition of 'APIQuerySiteInfoGeneralInfo' hook for usage in bug 16288 "API: consider making closure status of wikis more clear with meta=siteinfo" --- 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 ); }