Needed to conditionally register API modules. The previous way, messing with globals
from extension functions, is getting problematic because Config class will make this
impossible.
Change-Id: I86b40aeec555dd6b3cd82cab31d96e85fdf0a665
to allow extensions to override how links to pages are rendered within NS_CATEGORY
* (T19665) Special:WantedPages only lists page which having at least one red link
pointing to it.
+* New hooks 'ApiMain::moduleManager' and 'ApiQuery::moduleManager', can be
+ used for conditional registration of API modules.
==== External libraries ====
* MediaWiki now requires certain external libraries to be installed. In the past
* ApiQueryDeletedrevs
* Default type param for ApiQueryWatchlist and ApiQueryRecentChanges has
been changed from all types (e.g. including 'external') to 'edit|new|log'.
+* New hooks 'ApiMain::moduleManager' and 'ApiQuery::moduleManager', can be
+ used for conditional registration of API modules.
=== Languages updated in 1.25 ===
&$help: Array of HTML strings to be joined for the output.
$options: Array Options passed to ApiHelp::getHelp
+'ApiMain::moduleManager': Called when ApiMain has finished initializing its
+module manager. Can be used to conditionally register API modules.
+$moduleManager: ApiModuleManager Module manager instance
+
'ApiOpenSearchSuggest': Called when constructing the OpenSearch results. Hooks
can alter or append to the array.
&$results: array with integer keys to associative arrays. Keys in associative
(url), 'width', 'height', 'alt', 'align'.
- url: Url for the given title.
+'ApiQuery::moduleManager': Called when ApiQuery has finished initializing its
+module manager. Can be used to conditionally register API query modules.
+$moduleManager: ApiModuleManager Module manager instance
+
'APIQueryAfterExecute': After calling the execute() method of an
action=query submodule. Use this to extend core API modules.
&$module: Module object
$this->mModuleMgr->addModules( self::$Formats, 'format' );
$this->mModuleMgr->addModules( $config->get( 'APIFormatModules' ), 'format' );
+ Hooks::run( 'ApiMain::moduleManager', array( $this->mModuleMgr ) );
+
$this->mResult = new ApiResult( $this );
$this->mEnableWrite = $enableWrite;
$this->mModuleMgr->addModules( self::$QueryMetaModules, 'meta' );
$this->mModuleMgr->addModules( $config->get( 'APIMetaModules' ), 'meta' );
+ Hooks::run( 'ApiQuery::moduleManager', array( $this->mModuleMgr ) );
+
// Create PageSet that will process titles/pageids/revids/generator
$this->mPageSet = new ApiPageSet( $this );
}