Diagnosis extension

Fremantle

· MediaWiki · extensions · software · Wikimedia ·

I've been hacking a bit this morning on the Diagnosis extension, about an old idea to make an 'installation check' sort of a page, which lists various attributes of the MediaWiki installation and draws attention to things that might be wrong.

A few other open source web applications do a similar thing (these screenshots are from my local installations of these, which are usually full of problems):

I'm thinking that an extension attribute array could work well for extensions to opt in to adding 'Checks', e.g. in extension.json:

	"attributes": {
		"MyExt": {
			"Checks": [
				{
					"class": "MediaWiki\\Extension\\MyExt\\Check\\FoobarCheck",
					"services": [
						"SomeService"
					]
				}
			]
		}
	},

And then each Check would implement something like this:

interface Check {
	/**
	 * @return string HTML for the check title.
	 */
	public function getTitle(): string;
	/**
	 * Quick checks are run when Special:Diagnosis is opened; others must be triggered by the user.
	 */
	public function isQuick(): bool;
	/**
	 * The result of the check, containing whatever HTML should be displayed
	 * and a status (of success/warning/etc.) that determines the icon etc.
	 */
	public function getResult(): StatusValue;
}
← Previous