WikiDB/Installation

From TestWiki
< WikiDB
Revision as of 03:38, 9 July 2006 by HappyDog (Talk | contribs) (Basic info)

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

Aside from installing the extension in the usual way, you need to do the following to get the extension up and running:

  1. Create the required tables in your database. In the finished version there will be an install script to do this for you.
  2. Create the appropriate extra namespace(s), using $wgExtraNamespaces. Remember to create the 'talk' namespace(s) as well!
  3. Add the namespace(s) that you want to use to hold table definitions to the $wgWikiDBNamespaces array.

For example, the setup file for this wiki contains the following extra lines:

include("WikiDB.php");
 
$wgExtraNamespaces = array(
	100 => "Table", 
	101 => "Table_Talk"
);
 
$wgWikiDBNamespaces = array(
	100 => true
);

Note that you may define as many DB 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 DB namespace will be enough.

If you are using more than one DB namespace, the first one in the $wgWikiDBNamespaces array is used as the default table namespace in table attributes where no namespace is supplied. For example, say you have two table namespaces 'Foo' and 'Bar', with 'Foo' being defined first in the array. If you add some data as follows: <data table="Humbug"> it will be added to the table "Foo:Humbug", because "Foo" is the default DB namespace. To add it to "Bar:Humbug" as intended, you would need to use the full name: <data table="Bar:Humbug">.