blob: a0e3a5203d163226beb85a4fb4fb707e7beaf796 (
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
25
26
27
28
29
30
31
32
33
|
<?
$wiki_root = $argv[1];
$mw_root = '/usr/share/mediawiki';
if (!is_dir("$wiki_root/config")) {
exit(1);
}
// 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();
$dir = "$wiki_root/config";
foreach (scandir($dir) as $item) {
if (!is_dir($item) || is_link($item))
unlink($item);
}
rmdir("$dir");
?>
|