Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/97926


Change subject: API: Add $wgAPIFormatModules
......................................................................

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
---
M includes/DefaultSettings.php
M includes/api/ApiMain.php
2 files changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/26/97926/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 951dc21..e23aea4 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -6539,6 +6539,7 @@
  * @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 a9aebe9..861fa82 100644
--- a/includes/api/ApiMain.php
+++ b/includes/api/ApiMain.php
@@ -185,11 +185,12 @@
                        }
                }
 
-               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;

-- 
To view, visit https://gerrit.wikimedia.org/r/97926
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0bd253104a4b5bc56d4fe0dc6736e2129b126f3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to