aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/mediawiki/files/init_wiki.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/mediawiki/files/init_wiki.php b/modules/mediawiki/files/init_wiki.php
new file mode 100644
index 00000000..bb2137ae
--- /dev/null
+++ b/modules/mediawiki/files/init_wiki.php
@@ -0,0 +1,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");
+?>