Semantic MediaWiki and related extensions
|
Extensions maintained by the project try follow some simple guidelines, also to make maintenance easier with a common infrastructure and setup:
Composer
as deployment toolextension.json
Some general guidelines are:
composer.json
PSR-4
and a PHP namespace to distinguish a codebase from other repositories that may use similar (or even the same) class/interface names.The following extensions can be used as inspiration on "How to write an extension" in connection with Semantic MediaWiki.
SemanticMetaTags
SemanticApprovedRevs
SemanticExtraSpecialProperties
SemanticBreadcrumbLinks
SemanticScribunto
SemanticGlossary
It has been good practice to code around the following files and folders structure:
docs/ i18n/ src/ tests/
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:
.travis.yml
tests/travis
folder and adapt the necessary referencesphpunit.xml.dist
and the tests/bootstrap.php
and make necessary changes"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/" } }
{ "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 }
/** * Extension ... * *