$wgExtensionFunctions is called before the RequestContext is really
available (i.e. getTitle() is null, accessing the User object may fail
because other extensions' UserLoadFromSession hooks don't expect to be
called that early, etc). The index.php code path has BeforeInitialize to
take action after RequestContext is available but before much else
happens, but the API doesn't (yet) have anything similar.
Bug: 58380
Change-Id: I0a167faaa4166da381194c53373d82e038848924
* (bug 52005) Special pages RecentChanges, RecentChangesLinked and Watchlist
now include a legend describing the symbols used in lists of changes.
* Improved the accessibility of the tabs in Special:Preferences.
* (bug 52005) Special pages RecentChanges, RecentChangesLinked and Watchlist
now include a legend describing the symbols used in lists of changes.
* Improved the accessibility of the tabs in Special:Preferences.
+* Added ApiBeforeMain hook, roughly equivalent to the BeforeInitialize hook:
+ it's called after everything is set up but before any major processing
+ happens.
=== Bug fixes in 1.23 ===
* (bug 41759) The "updated since last visit" markers (on history pages, recent
=== Bug fixes in 1.23 ===
* (bug 41759) The "updated since last visit" markers (on history pages, recent
*/
$processor = new ApiMain( RequestContext::getMain(), $wgEnableWriteAPI );
*/
$processor = new ApiMain( RequestContext::getMain(), $wgEnableWriteAPI );
+// Last chance hook before executing the API
+wfRunHooks( 'ApiBeforeMain', array( &$processor ) );
+
// Process data & print results
$processor->execute();
// Process data & print results
$processor->execute();
this to extend core API modules.
&$module: Module object
this to extend core API modules.
&$module: Module object
+'ApiBeforeMain': Before calling ApiMain's execute() method in api.php.
+&$main: ApiMain object
+
'ApiCheckCanExecute': Called during ApiMain::checkCanExecute. Use to further
authenticate and authorize API clients before executing the module. Return
false and set a message to cancel the request.
'ApiCheckCanExecute': Called during ApiMain::checkCanExecute. Use to further
authenticate and authorize API clients before executing the module. Return
false and set a message to cancel the request.