Page MenuHomePhabricator

Hook extensions can use to introduce a new ApiFormat* class
Closed, ResolvedPublic

Description

I could be missing it, but I'm not seeing how to do this. A hook called sometime before ApiMain::execute() would allow me to add to the list of formatter classes to implement alternative output formats. (I think this would be a cleaner way to implement server-side events than I currently have in https://github.com/worden-lee/cometdemo.)


Version: 1.23.0
Severity: normal

Details

Reference
bz57637

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:23 AM
bzimport set Reference to bz57637.
bzimport added a subscriber: Unknown Object (MLST).

Rather than a hook, it might be better to do this with a $wgAPIFormatModules global, along the lines of all the other $wgAPI*Modules globals we already have.

While I can see how a hook might be useful, if used for adding modules generally it would probably be a performance hit versus the globals.

Change 97926 had a related patch set uploaded by Anomie:
API: Add $wgAPIFormatModules

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

Change 97926 merged by jenkins-bot:
API: Add $wgAPIFormatModules

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

patch for global config was merged

Change 99245 had a related patch set uploaded by Anomie:
RELEASE-NOTES entry for Ia0bd2531

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

(In reply to comment #5)

$wgAPIFormatModules needs mention in RELEASE-NOTES and documentation at
https://www.mediawiki.org/wiki/Manual:$wgAPIFormatModules

Thanks, done.

Change 99245 merged by jenkins-bot:
RELEASE-NOTES entry for Ia0bd2531

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