Installation − Example "composer.local.json" file

From semantic-mediawiki.org
< Installation(Redirected from Installation − Example "composer.local.json" file)
Administrator manualInstallationInstallation − Example "composer.local.json" file

This help page shows examples for your "composer.local.json" (≥ MW 1.24.x) file if you install Semantic MediaWiki.

Semantic MediaWiki
{
    "require": {
        "mediawiki/semantic-media-wiki": "~3.1.0"
    }
}
If you want to use a newer version of Semantic MediaWiki you will have to change the version requirement from "~3.0.0" to e.g. "~3.1.0" etc.
Semantic MediaWiki and extension "Semantic Result Formats"Provides additional formats for semantic queries
{
    "require": {
        "mediawiki/semantic-media-wiki": "~3.1.0",
        "mediawiki/semantic-result-formats": "~3.1.0"
    }
}
  • If you want to use newer versions you will have to change the respective version requirements as advised in the "README" files of the respective software.
  • In case you would like to create the "composer.json" file automatically by running commands on your server's shell please refer to the respective help page. This is however discouraged since it is not upgrade proof, i.e. the "composer.json" file gets overwritten on every update of MediaWiki and you have to start all over again.

Live example[edit]

This wiki currently uses the following "composer.local.json" file which is specifying a wide set of different and mostly semantic extensions:

{
	"require": {
		"elasticsearch/elasticsearch": "~6",
		"jeroen/mediawiki-github": "~1",
		"mediawiki/bootstrap": "~1",
		"mediawiki/bootstrap-components": "~1",
		"mediawiki/chameleon-skin": "~1",
		"mediawiki/graph-viz": "~3",
		"mediawiki/image-map": "dev-REL1_31",
		"mediawiki/lingo": "~3",
		"mediawiki/mermaid": "~2.0.0",
		"mediawiki/maps": "~7",
		"mediawiki/parser-hooks": "~1",
		"mediawiki/validator": "~2",
		"mediawiki/semantic-breadcrumb-links": "~2",
		"mediawiki/semantic-cite": "~2",
		"mediawiki/semantic-compound-queries": "~2",
		"mediawiki/semantic-extra-special-properties": "~2",
		"mediawiki/semantic-glossary": "~3",
		"mediawiki/semantic-interlanguage-links": "~2",
		"mediawiki/semantic-media-wiki": "~3.1.0",
		"mediawiki/semantic-meta-tags": "~2",
		"mediawiki/semantic-result-formats": "~3.1.0@dev",
		"mediawiki/semantic-scribunto": "~2",
		"professional-wiki/id-generator": "~1",
		"professional-wiki/modern-timeline": "~1",
		"phpoffice/phpspreadsheet": "~1"
	},
	"extra": {
		"merge-plugin": {
			"include": [
				"extensions/Elastica/composer.json",
				"extensions/Mpdf/composer.json",
				"extensions/SyntaxHighlight_GeSHi/composer.json"
			]
		}
	},
	"config": {
		"preferred-install": "source",
		"optimize-autoloader": true
	}
}
  • The "extra" section is specific to additional extension that my require it such as the Mpdf extension or the SyntaxHighlight extension. If you do not have installed it you do not need to worry about this section and you can omit it.
  • The "config" section is suggested but optional in case you have Git installed on your server. If not you do not need to worry about this section and you can omit it.