WikiDB/Configuration settings

From TestWiki
< WikiDB
Revision as of 13:40, 25 February 2011 by HappyDog (Talk | contribs) (Documenting $wgWikiDBNamespaces ($wgWikiDBMaxRefreshRate not yet written...))

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes the settings that you may use to configure WikiDB. They should be set in LocalSettings.php, either before or after including the main WikiDB.php script. If you do not explicitly set a value for any of these settings, then the default value will be used, as described.

$wgWikiDBNamespaces

Default value: empty array

Whilst you technically don't need to set this setting, if you don't set it then you might as well not install WikiDB at all!

The format of the array is the same as the built-in MediaWiki setting $wgNamespacesWithSubpages, except in this case the array indicates any namespaces that should be treated as table namespaces. Note that you should *not* define talk namespaces as table namespaces!

A table namespace is a namespace where table definitions are stored, meaning that they have an enhanced syntax available to them in order to make these definitions, plus extra interface features such as the 'data' tab. On most wikis only a single table namespace will be required, but it should be noted that you may define as many table namespaces as you like. This could be useful if your wiki is used for several different projects that you want to keep separate, or if you want to grant users different rights for different namespaces. However, in most situations a single table namespace will be enough.

Note that in order for a table namespace to be created, you will also need to add the namespace and its talk page to the $wgExtraNamespaces array. You need both settings - $wgExtraNamespaces tells MediaWiki that the namespace exists, and $wgWikiDBNamespaces tells WikiDB to use this namespace as a table namespace. For an example of how this looks, see the installation page.

When you refer to a table within the wiki, you may omit the namespace (e.g. you can just use 'Countries' instead of 'Table:Countries') and in these situations the default table namespace will be assumed (whether or not the named table is defined in that namespace). The default namespace is the one defined first in the $wgWikiDBNamespaces array. For example, say you have two table namespaces 'ProjectTable' and 'UserTable', with 'ProjectTable' being defined first in the array. If you add some data as follows: <data table="Languages"> it will be added to the table "ProjectTable:Languages", because "ProjectTable" is the default DB namespace. To add it to "UserTable:Languages" you would need to use the full name: <data table="UserTable:Languages">.

$wgWikiDBMaxRefreshRate

Default value: 100

To be written...