From: Brad Jorsch Date: Wed, 27 Nov 2013 16:40:17 +0000 (-0500) Subject: API: Add $wgAPIFormatModules X-Git-Tag: 1.31.0-rc.0~17876 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=9984a60ab6f79591bccbb672d55776001b80f684;p=lhc%2Fweb%2Fwiklou.git API: Add $wgAPIFormatModules The API currently allows for adding action modules with $wgAPIModules and query modules with various other $wgAPI*Modules variables. But there's no way to add a formatting module from an extension. For parallelism, let's add $wgAPIFormatModules to do just that. Bug: 57637 Change-Id: Ia0bd253104a4b5bc56d4fe0dc6736e2129b126f3 --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 951dc21552..e23aea481f 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -6539,6 +6539,7 @@ $wgDebugAPI = false; * @todo Describe each of the variables, group them and add examples */ $wgAPIModules = array(); +$wgAPIFormatModules = array(); $wgAPIMetaModules = array(); $wgAPIPropModules = array(); $wgAPIListModules = array(); diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index a9aebe9330..861fa82b2a 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -185,11 +185,12 @@ class ApiMain extends ApiBase { } } - global $wgAPIModules; + global $wgAPIModules, $wgAPIFormatModules; $this->mModuleMgr = new ApiModuleManager( $this ); $this->mModuleMgr->addModules( self::$Modules, 'action' ); $this->mModuleMgr->addModules( $wgAPIModules, 'action' ); $this->mModuleMgr->addModules( self::$Formats, 'format' ); + $this->mModuleMgr->addModules( $wgAPIFormatModules, 'format' ); $this->mResult = new ApiResult( $this ); $this->mEnableWrite = $enableWrite;