/[adm]/puppet/modules/mediawiki/files/init_wiki.php
ViewVC logotype

Contents of /puppet/modules/mediawiki/files/init_wiki.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2868 - (show annotations) (download)
Sat Sep 29 08:39:08 2012 UTC (9 years, 7 months ago) by boklm
File size: 847 byte(s)
exit if config directory doesn't exist
1 <?
2 $wiki_root = $argv[1];
3 $mw_root = '/usr/share/mediawiki';
4
5 if (!is_dir("$wiki_root/config")) {
6 exit(1);
7 }
8
9 // DefaultSettings.php complain if not defined
10 define('MEDIAWIKI',1);
11
12 require_once("$mw_root/includes/Defines.php");
13 require_once("$mw_root/includes/AutoLoader.php");
14 require_once("$mw_root/includes/GlobalFunctions.php");
15 include("$wiki_root/LocalSettings.php");
16
17 $dbclass = 'Database'.ucfirst($wgDBtype);
18 $dbc = new $dbclass;
19
20 $wgDatabase = $dbc->newFromParams($wgDBserver,
21 $wgDBuser,
22 $wgDBpassword, $wgDBname, 1);
23
24 $wgDatabase->initial_setup($wgDBpassword, $wgDBname);
25 $wgDatabase->setup_database();
26
27 $dir = "$wiki_root/config";
28 foreach (scandir($dir) as $item) {
29 if (!is_dir($item) || is_link($item))
30 unlink($item);
31 }
32 rmdir("$dir");
33 ?>

  ViewVC Help
Powered by ViewVC 1.1.28