Commit graph

6 commits

Author SHA1 Message Date
MGChecker
eb6b4d8e7e registration: Add ability to check if a specific extension version is loaded
As it's quite common that extensions and skins interact with each other, it's
useful to have a simple way to check if an extension version satisfies a
given constraint, as extensions change over time.

Bug: T202955
Change-Id: I19f9713caf89d647072a2bd7d598e739be383f4a
2018-09-03 14:37:33 -07:00
Florian Schmidt
45cebbe9f6 registration: Validate no duplicate keys exist in extension.json
The JSON specification permits duplicate keys, but doing so is almost
always nearly a mistake.

We can use the JSON lint library (added as
dev-requirement to composer), which is now also used to decode the
JSON (as it's the same step as validating the JSON).

Bug: T153507
Change-Id: Ia713a1906169333c1aa2aebdc0ed060d26428d72
2018-07-18 09:29:43 +00:00
Antoine Musso
224864ebdd registration: Initialize PSR-4 namespaces at same stage as normal autoloader
readFromQueue() injects the content of AutoloadClasses to
$wgAutoloadClasses however it missed doing the same for
AutoloadNamespaces.

When using the installer with an extension having AutoloadNamespaces
set, its classes would not be found.

Make ExtensionRegistry append to AutoLoader::$psr4Namespaces, and add
a test to cover the new behavior.

Bug: T195783
Change-Id: Id61155867a4ca7d9bc4a347f8671da74b0fa490b
2018-05-30 13:07:42 -07:00
Kunal Mehta
b165908616 Improve ExtensionRegistry test coverage
Change-Id: Id1b87e020a220c96b42d86485da67d47b9d565f9
2018-05-27 20:36:41 -07:00
Kunal Mehta
399b391f24 registration: Perform extra validation for mediawiki.org URLs
If the "url" field in extension.json is pointing to mediawiki.org,
perform some extra validation steps:
* Require HTTPS
* Require the `www.mediawiki.org` canonical domain

Change-Id: I3371443d3f6c76f53437adf90a700969bba7d0e7
2018-05-19 16:26:15 -07:00
Kunal Mehta
08b2cf6638 Add tests for ExtensionJsonValidator
Change-Id: I883a502fc3ed6cd7b8651d9e5e78dba7177ead9c
2018-02-09 23:37:22 -08:00