<?php
$wgCommandLineMode = true;
-
+# Turn off output buffering if it's on
+@ob_end_flush();
+
$sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
-if ( $argv[1] ) {
+if ( isset($argv[1]) && $argv[1] ) {
$lang = $argv[1];
putenv( "wikilang=$lang");
$settingsFile = "/apache/htdocs/{$argv[1]}/w/LocalSettings.php";
$newpath = "";
}
-if ( $argv[2] == "update" ) {
+if ( isset($argv[2]) && $argv[2] == "update" ) {
$response = 1;
-} elseif ( $argv[2] == "reinitialise" ) {
+} elseif ( isset($argv[2]) && $argv[2] == "reinitialise" ) {
$response = 2;
} else {
$response = 0;
$wgCommandLineMode = true;
set_time_limit(0);
-if ( count( $argv ) >= 3 ) {
+if ( isset($argv) && count( $argv ) >= 3 ) {
$messages = loadArrayFromFile( $argv[3] );
} else {
$messages = false;