Last modified: 2013-12-06 10:25:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59637, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57637 - Hook extensions can use to introduce a new ApiFormat* class
Hook extensions can use to introduce a new ApiFormat* class
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.23.0
All All
: Normal normal (vote)
: 1.23.0 release
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-27 03:15 UTC by Lee Worden
Modified: 2013-12-06 10:25 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Lee Worden 2013-11-27 03:15:02 UTC
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.)
Comment 1 Brad Jorsch 2013-11-27 16:44:08 UTC
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.
Comment 2 Gerrit Notification Bot 2013-11-27 16:44:30 UTC
Change 97926 had a related patch set uploaded by Anomie:
API: Add $wgAPIFormatModules

https://gerrit.wikimedia.org/r/97926
Comment 3 Gerrit Notification Bot 2013-11-27 17:08:22 UTC
Change 97926 merged by jenkins-bot:
API: Add $wgAPIFormatModules

https://gerrit.wikimedia.org/r/97926
Comment 4 db [inactive,noenotif] 2013-12-04 19:57:22 UTC
patch for global config was merged
Comment 5 Jesús Martínez Novo (Ciencia Al Poder) 2013-12-04 20:06:49 UTC
$wgAPIFormatModules needs mention in RELEASE-NOTES and documentation at https://www.mediawiki.org/wiki/Manual:$wgAPIFormatModules
Comment 6 Gerrit Notification Bot 2013-12-04 20:57:47 UTC
Change 99245 had a related patch set uploaded by Anomie:
RELEASE-NOTES entry for Ia0bd2531

https://gerrit.wikimedia.org/r/99245
Comment 7 Brad Jorsch 2013-12-04 20:58:53 UTC
(In reply to comment #5)
> $wgAPIFormatModules needs mention in RELEASE-NOTES and documentation at
> https://www.mediawiki.org/wiki/Manual:$wgAPIFormatModules

Thanks, done.
Comment 8 Gerrit Notification Bot 2013-12-04 21:03:03 UTC
Change 99245 merged by jenkins-bot:
RELEASE-NOTES entry for Ia0bd2531

https://gerrit.wikimedia.org/r/99245
Comment 9 Lee Worden 2013-12-06 05:49:12 UTC
Awesome, thanks!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links