resourceloader: Run ResourceLoaderRegisterModules after wgResourceModules
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 16 Jun 2015 21:14:10 +0000 (22:14 +0100)
committerKrinkle <krinklemail@gmail.com>
Fri, 18 Sep 2015 19:06:03 +0000 (19:06 +0000)
commit926a83a07d6bf29965fd56008cb0df68c959e4ea
treefb5074b7fc9035f8ed26bd52bab0c52d8e435912
parent6f3372b1c9fa02d346e45be81b99a166f493f954
resourceloader: Run ResourceLoaderRegisterModules after wgResourceModules

We don't allow modifying existing modules or registering the same module twice.

We do have an established convention of registering plugins for optional
dependencies conditionally.

E.g.
- VisualEditor should only register 'uls.data' if ULS extension isn't installed.
- The Math extension should only register its VE plugin if VE is installed.

Typically the dependency being checked is registered unconditionally. The
conditional one is the supplemental one in case the canonical source within
the MediaWiki landscape is absent.

Currently this means code will check both isModuleRegistered() and the global
$wgResourceModules. This doesn't make sense. Reverse this so that the
unconditional registry is processed first, and the programmatic one after.

This also helps exceptions come from a more sensible place in case of a duplicate
registration.

Change-Id: Ib2d01c88511ade75a97b2509bccfabb1a4cc5c15
includes/resourceloader/ResourceLoader.php