Last modified: 2014-10-30 19:33:12 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 T68870, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66870 - Allow registration of API modules and special pages as a factory function.
Allow registration of API modules and special pages as a factory function.
Status: NEW
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
u=dev c=backend p=0
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-20 10:03 UTC by Daniel Kinzler
Modified: 2014-10-30 19:33 UTC (History)
8 users (show)

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


Attachments

Description Daniel Kinzler 2014-06-20 10:03:43 UTC
Currently, API modules and special pages are registered using class names, and instantiated with a fixed set of parameters to the constructor. This makes proper dependency injection impossible. The solution is to allow factory functions for registering such modules. That would give the implementor full control over the constructor arguments.

The same approach is already used with the new ConfigFactory. ContentHandler uses a hook to achieve the same.
Comment 1 Brad Jorsch 2014-06-20 15:43:20 UTC
I note this was tried before in Gerrit change #49781, and abandoned because it turned out to be too much work at the time.
Comment 2 Umherirrender 2014-10-30 19:33:12 UTC
Already fixed?
- api part maybe Gerrit change #149183
- special page part maybe Gerrit change #152755

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


Navigation
Links