< Manual:Hooks 
 
      | ApiBeforeMain | |
|---|---|
| Available from version 1.23.0 (Gerrit change 100996) Occurs before ApiMain's execute is called to process the request. | |
| Define function: | public static function onApiBeforeMain( &$main ) { ... }
 | 
| Attach hook: | In extension.json: {
	"Hooks": {
		"ApiBeforeMain": "MyExtensionHooks::onApiBeforeMain"
	}
}
 | 
| Called from: | File(s): ../api.php | 
| Interface: | ApiBeforeMainHook.php | 
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:ApiBeforeMain extensions.
Details
- &$main: ApiMain being used for request
See also
- Manual:Hooks/BeforeInitialize: A roughly-equivalent hook for requests to index.php
    This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.