Allow factory functions for creating API modules.
authordaniel <daniel.kinzler@wikimedia.de>
Thu, 24 Jul 2014 22:37:52 +0000 (00:37 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Wed, 6 Aug 2014 20:58:14 +0000 (22:58 +0200)
commitbaa11f7430971936c9add1605fc3ed193bcfa5f4
tree1dd404d22d4789655bf7509d42d106d1a6b30a12
parent47353ec30965d1fce735e19dd06f8462cde8775b
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
RELEASE-NOTES-1.24
includes/DefaultSettings.php
includes/api/ApiModuleManager.php
tests/phpunit/includes/api/ApiModuleManagerTest.php [new file with mode: 0644]
tests/phpunit/includes/api/PrefixUniquenessTest.php