Manual:updateExtensionJsonSchema.php

From Linux Web Expert

Revision as of 20:32, 16 July 2023 by imported>Clump (Reverted edits by 201.138.197.156 (talk) to last version by Wladek92)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.29
<translate> MediaWiki version:</translate>

Details

updateExtensionJsonSchema.php file is a maintenance script that converts an extension.json or skin.json file from manifest_version 1 to manifest_version 2.

Arguments

Argument Description Required
file Location of the extension.json or skin.json you wish to convert <translate> Required</translate>

Usage

php maintenance/updateExtensionJsonSchema.php path/to/my/extension.json

Before:

extensions/CreateUserPage/extension.json
{
	"name": "CreateUserPage",
	"version": "2.0",
	"author": [
		"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy Cicalese]"
	],
	"url": "https://www.mediawiki.org/wiki/Extension:Create_User_Page",
	"descriptionmsg": "createuserpage-desc",
	"license-name": "MIT",
	"type": "other",
	"MessagesDirs": {
		"CreateUserPage": [
			"i18n"
		]
	},
	"AutoloadClasses": {
		"CreateUserPageHooks": "includes/CreateUserPageHooks.php"
	},
	"Hooks": {
		"UserLoginComplete": "CreateUserPageHooks::onUserLoginComplete",
		"OutputPageParserOutput": "CreateUserPageHooks::onOutputPageParserOutput"
	},
	"config": {
		"CreateUserPage_PageContent": "{{User}}",
		"CreateUserPage_OnLogin": true,
		"CreateUserPage_AutoCreateUser": null
	},
	"manifest_version": 1
}
Terminal

After:

extensions/CreateUserPage/extension.json
{
	"name": "CreateUserPage",
	"version": "2.0",
	"author": [
		"[https://www.mediawiki.org/wiki/User:Cindy.cicalese Cindy Cicalese]"
	],
	"url": "https://www.mediawiki.org/wiki/Extension:Create_User_Page",
	"descriptionmsg": "createuserpage-desc",
	"license-name": "MIT",
	"type": "other",
	"MessagesDirs": {
		"CreateUserPage": [
			"i18n"
		]
	},
	"AutoloadClasses": {
		"CreateUserPageHooks": "includes/CreateUserPageHooks.php"
	},
	"Hooks": {
		"UserLoginComplete": "CreateUserPageHooks::onUserLoginComplete",
		"OutputPageParserOutput": "CreateUserPageHooks::onOutputPageParserOutput"
	},
	"config": {
		"CreateUserPage_PageContent": {
			"value": "{{User}}"
		},
		"CreateUserPage_OnLogin": {
			"value": true
		},
		"CreateUserPage_AutoCreateUser": {
			"value": null
		}
	},
	"manifest_version": 2,
	"requires": {
		"MediaWiki": ">= 1.29.0"
	}
}

See also