links schema conversion script, alterations to config/index.php and commandLine.inc...
[lhc/web/wiklou.git] / maintenance / commandLine.inc
1 <?php
2
3 if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
4 print "This script must be run from the command line\n";
5 exit();
6 }
7
8 $wgCommandLineMode = true;
9
10 $sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
11 if ( @$argv[1] && @$argv[1] != "-" ) {
12 $lang = $argv[1];
13 putenv( "wikilang=$lang");
14 $settingsFile = "/apache/htdocs/{$argv[1]}/w/LocalSettings.php";
15 $newpath = "/apache/common/php$sep";
16 } else {
17 $settingsFile = "../LocalSettings.php";
18 $newpath = "";
19 }
20
21 if ( ! is_readable( $settingsFile ) ) {
22 print "A copy of your installation's LocalSettings.php\n" .
23 "must exist in the source directory.\n";
24 exit();
25 }
26
27
28 $wgCommandLineMode = true;
29 $DP = "../includes";
30 include_once( $settingsFile );
31 ini_set( "include_path", "../includes$sep../languages$sep$newpath$IP$sep$include_path" );
32
33 $wgUsePHPTal = false;
34 include_once( "Setup.php" );
35 include_once( "./InitialiseMessages.inc" );
36 include_once( "../install-utils.inc" );
37 $wgTitle = Title::newFromText( "Rebuild messages script" );
38 $wgCommandLineMode = true;
39 set_time_limit(0);
40 ?>