Semantic MediaWiki and related extensions
developing

Extensions maintained by the project try follow some simple guidelines, also to make maintenance easier with a common infrastructure and setup:

Guidelines and conventions

Some general guidelines are:

Getting started ...

The following extensions can be used as inspiration on "How to write an extension" in connection with Semantic MediaWiki.

Technical notes

Files and folders

It has been good practice to code around the following files and folders structure:

docs/
i18n/
src/
tests/

Continuous integration

Using Travis-CI is fairly easy to set up and integrable with Semantic MediaWiki, the best approach is to select an existing repository and copy files such as:

composer.json

    "require": {
        "php": ">=5.6.0",
        "composer/installers": "1.*,>=1.0.1",
        "mediawiki/semantic-media-wiki": "~3.0"
    },
    "extra": {
        "branch-alias": {
            "dev-master": "0.1.x-dev"
        }
    },
    "autoload": {
        "files" : [
            "Foo.php"
        ],
        "psr-4": {
            "Foo\\": "src/"
        }
    }

extension.json

{
    "name": "Foo",
    "version": "0.1-alpha",
    "author": [
        "Foo",
        "..."
    ],
    "descriptionmsg": "foo-desc",
    "namemsg": "foo-name",
    "license-name": "GPL-2.0-or-later",
    "type": "foo",
    "requires": {
        "MediaWiki": ">= 1.30"
    },
    "MessagesDirs": {
        "Foo": [
            "i18n"
        ]
    },
    "callback": "Foo::initExtension",
    "ExtensionFunctions": [
        "Foo::onExtensionFunction"
    ],
    "load_composer_autoloader":true,
    "manifest_version": 1
}

Foo.php

/**
 * Extension ...
 *
 * 

About | General disclaimer | Privacy policy