Page MenuHomePhabricator

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


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

Version: 1.23.0
Severity: normal



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

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

patch for global config was merged

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

(In reply to comment #5)

$wgAPIFormatModules needs mention in RELEASE-NOTES and documentation at$wgAPIFormatModules

Thanks, done.

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