aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mediawiki/files/init_wiki.php
blob: bb2137ae0b7af8e63d315de0125afedf8ffa2013 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?
$wiki_root = $argv[1];
$mw_root = '/usr/share/mediawiki';

// DefaultSettings.php complain if not defined
define('MEDIAWIKI',1);

require_once("$mw_root/includes/Defines.php");
require_once("$mw_root/includes/AutoLoader.php");
require_once("$mw_root/includes/GlobalFunctions.php");
include("$wiki_root/LocalSettings.php");

$dbclass = 'Database'.ucfirst($wgDBtype);
$dbc = new $dbclass;

$wgDatabase = $dbc->newFromParams($wgDBserver,
                                  $wgDBuser,
                                  $wgDBpassword, $wgDBname, 1);

$wgDatabase->initial_setup($wgDBpassword, $wgDBname);
$wgDatabase->setup_database();

rmdir("$wiki_root/config");
?>