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.

MediaWiki 1.22+

Semantic MediaWiki
{
    "require": {
        "mediawiki/semantic-media-wiki": "~2.2"
    }
}

NoteNote:

  • If you want to use an newer version of Semantic MediaWiki you will have to change the version requirement from "~2.2" to e.g. "~2.3" etc.


Semantic MediaWiki and Semantic Result Formats
{
    "require": {
        "mediawiki/semantic-media-wiki": "~2.2",
        "mediawiki/semantic-result-formats": "~2.1"
    }
}

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.


MediaWiki 1.19.x and 1.21.x

For MediaWiki 1.19.x and 1.21.x the Extension Installer extension is required to use Composer. The file should be placed into the folder …/extensions/ExtensionInstaller/ of your MediaWiki installation:

Semantic MediaWiki
{
        "require": {
                "php": ">=5.3.2",
                "mediawiki/semantic-media-wiki": "~1.9"
        },
        "config": {
                "vendor-dir": "../../vendor"
        },
        "extra": {
                "installer-paths": {
                        "../../extensions/{$name}": ["type:mediawiki-extension"]
                }
        }
}

NoteNote:  If you want to use an newer version of Semantic MediaWiki you will have to change the version requirement from "~1.9" to e.g. "~2.0" etc.


Semantic MediaWiki and Semantic Result Formats
{
        "require": {
                "php": ">=5.3.2",
                "mediawiki/semantic-media-wiki": "~1.9",
                "mediawiki/semantic-result-formats": "~1.9"
        },
        "config": {
                "vendor-dir": "../../vendor"
        },
        "extra": {
                "installer-paths": {
                        "../../extensions/{$name}": ["type:mediawiki-extension"]
                }
        }
}

NoteNote:

  • You may add many more extensions to the "require" section of this file which support Composer. Make sure that each line, except the last one, has a comma at the end.
  • Make sure that you do not use these examples for installing extensions on ≥ MW 1.22. You will not need the "Extension installer" extension as well as the "config" and "extra" settings.
  • 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.