Page MenuHomePhabricator

Allow registration of API modules and special pages as a factory function.
Closed, ResolvedPublic

Description

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.


Version: unspecified
Severity: enhancement
Whiteboard: u=dev c=backend p=0

Details

Reference
bz66870

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:25 AM
bzimport set Reference to bz66870.
bzimport added a subscriber: Unknown Object (MLST).

I note this was tried before in Gerrit change 49781, and abandoned because it turned out to be too much work at the time.

Already fixed?

  • api part maybe gerrit 149183
  • special page part maybe gerrit 152755
Anomie assigned this task to daniel.
Anomie set Security to None.

Already fixed?

  • api part maybe gerrit 149183
  • special page part maybe gerrit 152755

Looks like it to me.