Implements:
* Gadget definition content and content handler
* Basic validation for gadget definition content
* GadgetDefinitionNamespace implementation of GadgetRepo
* DataUpdates upon editing/deletion of Gadget definition pages
* EditFilterMerged hook for improved error messages
* 'GadgetsRepoClass' option to switch GadgetRepo implementation used
* Lazy-load the GadgetResourceLoaderModule class so we don't need to
load each individual gadget object unless its needed
Note that Special:Gadgets's export feature intentionally doesn't work
yet, and will be fixed in a follow up patch.
Bug: T106177
Change-Id: Ib11db5fb0f7b46793bfa956cf1367f1dc1059b1c
GadgetRepo is an abstract class based off of the implementation in the
RL2 branch.
It is a singleton that provides basic methods to construct and interact
with Gadget objects.
The MediaWikiGadgetsDefinition class is an implementation of GadgetsRepo
that parses the "MediaWiki:Gadgets-definition" page for gadget
definitions.
Tests were left in place to demonstrate that no functional changes have
been made aside from relocation of code. Some tests should be moved to
separate files in the future.
Bug: T106176
Change-Id: I3e802889f6f495783f4dbac65c2a8cefa824a778
* Bumped the key version due to key wrapping
* Removed isValidList() gived the key versioning
* Follow up ba1311c323 by making APC viable;
previously, definition purges would not work
Bug: T93141
Change-Id: I6da3eede044bf4b840b3f9656a1ae8105941dc6b
* Reduce globals usage thanks to core improvements
* Use new assertion that wasn't available before
Change-Id: I9b7fb065ea9e235e6c5e7ea5116ccacac91f8846
Though the hook registration was working fine, the run from
Jenkins was failing.
Jenkins runs like this:
$ php tests/phpunit/phpunit.php extensions/Gadgets
Which bypasses UnitTestsList and uses auto-discovery within the
given directory of "*.Test.php" files.
Renamed to file to match PHPUnit's internal discovery pattern
and updated the onUnitTestsList callback to use this pattern
as well.
Also updated documentation applied recent code conventions in
this area (extend MediaWikiTestCase).
Change-Id: Iaa52a5eafdebf1529dd02fb1bed89d27c298e0d3