Commit graph

4 commits

Author SHA1 Message Date
Kunal Mehta
ad9bb085a6 Add ApiModuleManager::getClassName()
In cases where an extension has multiple API modules that
have the same exact factory requirements, it would let them
use the same factory function and check with the module manager
what the class name to construct should be. This is already possible
using getNamesWithClasses, but this makes it much more
straightforward.

Change-Id: I889e3e6f15907896a8df376913125d903debe984
2014-09-08 02:06:33 -07:00
Kunal Mehta
6f7e29a773 Make ApiModuleManagerTest::testAddModules un-risky
Change-Id: Idbea51cf45fc95676759e5ac9abb342701e5b551
2014-08-21 22:47:24 -07:00
umherirrender
ab20f80116 Fixed spacing
- Added newline at end of files
- Added/Removed spaces around comma, parentheses and negation
- Added space after function word

Change-Id: I2dd338153aeb5f07702ba015945e95c7d0ae673b
2014-08-13 20:14:56 +00:00
daniel
baa11f7430 Allow factory functions for creating API modules.
This enables factory functions to be registered for API modules,
in addition to the module class itself. This allows modules to
use proper dependency injection via the modules constructor.

Example:

  $wgAPIModules['foo'] = array(
    'class' => 'ApiFoo',
    'factory' => function( $main, $action ) { ... }
  )

Change-Id: Ieb85493a7765f466317f5fa74b0b0e262220deab
2014-08-06 22:58:14 +02:00