Media Wiki Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 57: Line 57:


Contains, among others, the following:
Contains, among others, the following:
* Database type:
====Database Type====
<syntaxhighlight lang='php'>
<syntaxhighlight lang='php'>
$wgDBtype = "mysql";
$wgDBtype = "mysql";
</syntaxhighlight>
</syntaxhighlight>
* Database hostname:
====Database Hostname====
<syntaxhighlight lang='php'>
<syntaxhighlight lang='php'>
$wgDBserver = "localhost";
$wgDBserver = "localhost";
</syntaxhighlight>
</syntaxhighlight>
* Database user ID:
====Database User ID====
<syntaxhighlight lang='php'>
<syntaxhighlight lang='php'>
$wgDBuser = "c3kb_wiki";
$wgDBuser = "c3kb_wiki";
</syntaxhighlight>
</syntaxhighlight>
* Database password:
====Database Password====
<syntaxhighlight lang='php'>
<syntaxhighlight lang='php'>
$wgDBpassword = "...";
$wgDBpassword = "...";
</syntaxhighlight>
</syntaxhighlight>
* Database default character set:
===Database Default Character Set====
<syntaxhighlight lang='php'>
<syntaxhighlight lang='php'>
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
</syntaxhighlight>
</syntaxhighlight>
* Database name:
====Database Name====
<syntaxhighlight lang='php'>
<syntaxhighlight lang='php'>
$wgDBname = "c3kb_wiki";
$wgDBname = "c3kb_wiki";
</syntaxhighlight>
====Site Name====
<syntaxhighlight lang='php'>
$wgSitename = "nokb";
</syntaxhighlight>
</syntaxhighlight>



Revision as of 17:54, 4 April 2021

Internal

Directory Layout

/
├── etc
│    ├── php.ini
│    └── php.d
│
└── var/www/mediawiki-X.Y.Z
              ├── LocalSettings.php
              ├── includes
              │     └── DefaultSettings.php
              ├── images
              │     ├── .htaccess
              │     ├── archive
              │     ├── lockdir
              │     ├── thumb
              │     └── c
              │         └── cf
              │             └── SomeImage.png
              ├── extensions
              │     ├── BreadCrumbs
              │     ├── CategoryTree
              │     └── ...
              └── ...

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:

apachectl graceful

to reload the configuration file without killing the server.

To find the location for the command line interpreter, run:

php --ini

To find the location for the web module, create a "phpinfo.php" file in http root, with the following content:

<?php
phpinfo();

and load it through the web 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. To enable a change, the web server needs to be restarted with:

apachectl graceful

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";

Site Name

$wgSitename = "nokb";

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