Help:Installation/Example "composer.local.json" file

From semantic-mediawiki.org
Jump to: navigation, search
InstallationHelp:Installation/Example "composer.local.json" file

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

Semantic MediaWiki
{
    "require": {
        "mediawiki/parser-hooks": "~1",
        "mediawiki/validator": "~2",
        "mediawiki/semantic-media-wiki": "~2.5"
    }
}

NoteNote:

  • If you want to use a newer version of Semantic MediaWiki you will have to change the version requirement from "~2.5" to e.g. "~3.0" etc.


Semantic MediaWiki and Semantic Result Formats
{
    "require": {
        "mediawiki/parser-hooks": "~1",
        "mediawiki/validator": "~2",
        "mediawiki/semantic-media-wiki": "~2.5",
        "mediawiki/semantic-result-formats": "~2.4"
    }
}

NoteNote:

  • 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

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

{
        "require": {
                "jeroen/mediawiki-github": "~1",
                "mediawiki/graph-viz": "~2",
                "mediawiki/image-map": "@dev",
                "mediawiki/lingo": "~2",
                "mediawiki/maps": "~4",
                "mediawiki/parser-hooks": "~1",
                "mediawiki/validator": "~2",
                "mediawiki/semantic-media-wiki": "~2.5",
                "mediawiki/semantic-cite": "~1",
                "mediawiki/semantic-compound-queries": "~1",
                "mediawiki/semantic-breadcrumb-links": "~1",
                "mediawiki/semantic-extra-special-properties": "~1",
                "mediawiki/semantic-glossary": "~2",
                "mediawiki/semantic-interlanguage-links": "~1",
                "mediawiki/semantic-meta-tags": "~1",
                "mediawiki/semantic-result-formats": "~2",
                "phpoffice/phpexcel": "~1"
        },
        "extra": {
                "merge-plugin": {
                        "include": [
                                "extensions/SyntaxHighlight_GeSHi/composer.json"
                        ]
                }
        },
        "config": {
                "preferred-install": "source",
                "optimize-autoloader": true
        }
}
NoteNote:
  • The "extra" section is specific to 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.