blob: 926c52fcc1b1dc09c27ebd263c8df7b13c0ddbfe (
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
|
<?
$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();
$dir = "$wiki_root/config";
foreach (scandir($dir) as $item) {
if (!is_dir($item) || is_link($item))
unlink($item);
}
rmdir("$dir");
?>
|