Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -269,6 +269,10 @@ |
270 | 270 | on &action=edit. |
271 | 271 | $EditPage : the EditPage object |
272 | 272 | |
| 273 | +'APIAfterExecute': after calling the execute() method of an API module. |
| 274 | +Use this to extend core API modules. |
| 275 | +&$module: Module object |
| 276 | + |
273 | 277 | 'APIEditBeforeSave': before saving a page with api.php?action=edit, |
274 | 278 | after processing request parameters. Return false to let the request |
275 | 279 | fail, returning an error message or an <edit result="Failure"> tag |
— | — | @@ -286,6 +290,15 @@ |
287 | 291 | &$module: Module object |
288 | 292 | &$desc: Array of parameter descriptions |
289 | 293 | |
| 294 | +'APIQueryAfterExecute': after calling the execute() method of an |
| 295 | +action=query submodule. Use this to extend core API modules. |
| 296 | +&$module: Module object |
| 297 | + |
| 298 | +'APIQueryGeneratorAfterExecute': after calling the executeGenerator() |
| 299 | +method of an action=query submodule. Use this to extend core API modules. |
| 300 | +&$module: Module object |
| 301 | +&$resultPageSet: ApiPageSet object |
| 302 | + |
290 | 303 | 'APIQueryInfoTokens': use this hook to add custom tokens to prop=info. |
291 | 304 | Every token has an action, which will be used in the intoken parameter |
292 | 305 | and in the output (actiontoken="..."), and a callback function which |
Index: trunk/phase3/includes/api/ApiQuery.php |
— | — | @@ -209,6 +209,7 @@ |
210 | 210 | foreach ($modules as $module) { |
211 | 211 | $module->profileIn(); |
212 | 212 | $module->execute(); |
| 213 | + wfRunHooks('APIQueryAfterExecute', array(&$module)); |
213 | 214 | $module->profileOut(); |
214 | 215 | } |
215 | 216 | } |
— | — | @@ -381,6 +382,7 @@ |
382 | 383 | // populate resultPageSet with the generator output |
383 | 384 | $generator->profileIn(); |
384 | 385 | $generator->executeGenerator($resultPageSet); |
| 386 | + wfRunHooks('APIQueryGeneratorAfterExecute', array(&$generator, &$resultPageSet)); |
385 | 387 | $resultPageSet->finishPageSetGeneration(); |
386 | 388 | $generator->profileOut(); |
387 | 389 | |
Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -415,6 +415,7 @@ |
416 | 416 | // Execute |
417 | 417 | $module->profileIn(); |
418 | 418 | $module->execute(); |
| 419 | + wfRunHooks('APIAfterExecute', array(&$module)); |
419 | 420 | $module->profileOut(); |
420 | 421 | |
421 | 422 | if (!$this->mInternalMode) { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -253,6 +253,8 @@ |
254 | 254 | * (bug 15535) prop=info&inprop=protection doesn't list pre-1.10 protections |
255 | 255 | if the page is also protected otherwise (1.10+ style or cascading) |
256 | 256 | * list=random now has rnredirect parameter, to get random redirects. |
| 257 | +* Added APIAfterExecute, APIQueryAfterExecute and APIQueryGeneratorAfterExecute |
| 258 | + hooks which allow for extending core modules in a cleaner way |
257 | 259 | |
258 | 260 | === Languages updated in 1.14 === |
259 | 261 | |