mwstake / mediawiki-componentloader
Required for proper initialization of MWStake components
Installs: 60 592
Dependents: 18
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 1
Open Issues: 1
Requires (Dev)
- jakub-onderka/php-console-highlighter: 0.4.0
- jakub-onderka/php-parallel-lint: 1.0.0
- mediawiki/mediawiki-codesniffer: 29.0.0
- mediawiki/minus-x: 1.0.0
This package is auto-updated.
Last update: 2024-11-11 08:47:35 UTC
README
ComponentLoader for MediaWiki
If a MWStake component needs to access variables from <mediawiki>/includes/DefaultSettings.php
(e.g. for registering a new "MediaWiki service") this can no longer be done in the regular static file autoloader, provided by Composer (See https://github.com/wikimedia/mediawiki/commit/80fd54ffb028a649e322ad5548832edaa9081954).
Therefore such components need to require the "componentloader" and extensions using the component must explicitly invoke the "componentloader" at manifest.callback
time!
This can easily be done, either directly within the manifest file (e.g. extension.json
):
"callback": "mwsInitComponents"
or, in custom code by direct invocation. E.g.
"callback": "MediaWiki\\Extension\\MyExt\\Setup::callback"
<?php namespace MediaWiki\Extension\MyExt; class Setup { public static function callback() { mwsInitComponents(); // Own code ...