Media Wiki Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 18: Line 18:
=Versions=
=Versions=
The MediaWiki version, as well as PHP, database and extension versions can be read from Special pages → Version → Installed software.
The MediaWiki version, as well as PHP, database and extension versions can be read from Special pages → Version → Installed software.
=php.ini=
php.ini is the PHP configuration file. After changing it, use:
<syntaxhighlight lang='bash'>
/usr/local/apache/bin/apachectl graceful
</syntaxhighlight>
to reload the configuration file without killing the server.


=LocalSettings.php=
=LocalSettings.php=

Revision as of 04:09, 27 December 2020

Internal

Directory Layout

/var/www/mediawiki-X.Y.Z
              │
              ├── LocalSettings.php
              ├── includes
              │      └── DefaultSettings.php
              ├── images
              │      └── DefaultSettings.php
              │
              └── ...

Versions

The MediaWiki version, as well as PHP, database and extension versions can be read from Special pages → Version → Installed software.

php.ini

php.ini is the PHP configuration file. After changing it, use:

/usr/local/apache/bin/apachectl graceful

to reload the configuration file without killing the server.

LocalSettings.php

https://www.mediawiki.org/wiki/Manual:LocalSettings.php

The file is located in the root of the MediaWiki installation /var/www/<installation-dir>/LocalSettings.php.

Contains, among others, the following:

  • Database type:
$wgDBtype = "mysql";
  • Database hostname:
$wgDBserver = "localhost";
  • Database user ID:
$wgDBuser = "c3kb_wiki";
  • Database password:
$wgDBpassword = "...";
  • Database default character set:
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
  • Database name:
$wgDBname = "c3kb_wiki";

DefaultSettings.php

MediaWiki:Common.css

A page that contains CSS modifications to be applied to all skins. If it does not exist, it can be created.

Used by:

Security

Security Concepts

Transclusion

https://www.mediawiki.org/wiki/Transclusion

Transclusion means the inclusion of the content of a document into another document by reference. The most common situation where transclusion is used is the use of templates: the same content can be included in multiple documents without having having to edit those documents separately.

Namespace

https://www.mediawiki.org/wiki/Help:Namespaces

Templates

https://www.mediawiki.org/wiki/Help:Templates


A template is a page in the "Template:" namespace that gets transcluded in regular pages that refer to it. This mechanism is useful to disseminate complex content into multiple target pages, while editing the source context in just one place and referring to it via a simple name from the target pages.

Template Declaration

To start a new template, declare a link in the "Template:" namespace, as shown below

[[Template:TestTemplate]]

follow the link, and edit it. The initiating page will contain the link to the template and can be used for access. For an example of actual template declarations see the "Editing - Blockquote" section.

Parameterized Templates

MediaWiki performs variable substitution in templates, where the variables are declared as {{{1}}}, {{{2}}}, etc. A template that contains variables is called a parameterized template.

Template Invocation

The template is invoked by enclosing the template name (without the Template: namespace prefix) between {{ }}.

Example:

{{SomeTemplate}}

If the template is parameterized, the parameters are provided in order, after the template name, preceded by "|".

Example:

{{SomeTemplate|paramenter one content|parameter two content}}

ImageMap

https://www.mediawiki.org/wiki/Extension:ImageMap