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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1760 - (hide annotations) (download)
Fri Jun 17 12:21:02 2011 UTC (10 years, 11 months ago) by misc
File size: 795 byte(s)
remove file in config/ directory before removing the directory ( as
rm_dir requires a empty directory )
1 misc 1749 <?
2     $wiki_root = $argv[1];
3     $mw_root = '/usr/share/mediawiki';
4    
5     // DefaultSettings.php complain if not defined
6     define('MEDIAWIKI',1);
7    
8     require_once("$mw_root/includes/Defines.php");
9     require_once("$mw_root/includes/AutoLoader.php");
10     require_once("$mw_root/includes/GlobalFunctions.php");
11     include("$wiki_root/LocalSettings.php");
12    
13     $dbclass = 'Database'.ucfirst($wgDBtype);
14     $dbc = new $dbclass;
15    
16     $wgDatabase = $dbc->newFromParams($wgDBserver,
17     $wgDBuser,
18     $wgDBpassword, $wgDBname, 1);
19    
20     $wgDatabase->initial_setup($wgDBpassword, $wgDBname);
21     $wgDatabase->setup_database();
22    
23 misc 1760 $dir = "$wiki_root/config";
24     foreach (scandir($dir) as $item) {
25     if (!is_dir($item) || is_link($item))
26     unlink($item);
27     }
28     rmdir("$dir");
29 misc 1749 ?>

  ViewVC Help
Powered by ViewVC 1.1.28