Jump to content

Template:ExtensionInstallComposer

From mediawiki.org


  • Add the repo url () as a "vcs repository" and the package name () and version to the require section of your composer.local.json. Example:
{
	"repositories": [
		{
			"type": "vcs",
			"url": ""
		}
	],
	"require": {
		"": ""
	}
}
  • Run the following command in your MediaWiki installation path
composer update --no-dev
wfLoadExtension( '' );
  • Yes Done Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Template documentation

This template can be used on extension description pages, where the extension features a composer.json with a proper name and type attribute. It is based on Composer/For_extensions#Installing_extensions_that_are_not_available_from_Packagist .

Example 1 - Version tag releases
{{ExtensionInstallComposer
|MyExtension
|vcs=https://github.com/wikimedia/mediawiki-extensions-MyExtension.git
|packageName=mediawiki/my-extension
|versionConstraint=1.0.*
}}
Result
{
	"repositories": [
		{
			"type": "vcs",
			"url": "https://github.com/wikimedia/mediawiki-extensions-MyExtension.git"
		}
	],
	"require": {
		"mediawiki/my-extension": "dev-REL1_43"
	}
}
  • Run the following command in your MediaWiki installation path
composer update --no-dev
wfLoadExtension( 'MyExtension' );
  • Yes Done Navigate to Special:Version on your wiki to verify that the extension is successfully installed.


Example 2 - LTS bound releases
{{ExtensionInstallComposer|MyExtension
|vcs=https://github.com/wikimedia/mediawiki-extensions-MyExtension.git
|packageName=mediawiki/my-extension
|versionConstraint=1.0.*
}}
Result
{
	"repositories": [
		{
			"type": "vcs",
			"url": "https://github.com/wikimedia/mediawiki-extensions-MyExtension.git"
		}
	],
	"require": {
		"mediawiki/my-extension": "dev-REL1_43"
	}
}
  • Run the following command in your MediaWiki installation path
composer update --no-dev
wfLoadExtension( 'MyExtension' );
  • Yes Done Navigate to Special:Version on your wiki to verify that the extension is successfully installed.