+ fix notices with $argv
authorAntoine Musso <hashar@users.mediawiki.org>
Fri, 23 Apr 2004 12:36:05 +0000 (12:36 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Fri, 23 Apr 2004 12:36:05 +0000 (12:36 +0000)
+ disable buffering output (prevent text from not showing in win2k console)
Todo: notice about $IP not set

maintenance/rebuildMessages.php

index 58bcdc6..d892f37 100755 (executable)
@@ -1,8 +1,10 @@
 <?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";
@@ -12,9 +14,9 @@ if ( $argv[1] ) {
        $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;
@@ -39,7 +41,7 @@ $wgTitle = Title::newFromText( "Rebuild messages script" );
 $wgCommandLineMode = true;
 set_time_limit(0);
 
-if ( count( $argv ) >= 3 ) {
+if ( isset($argv) && count( $argv ) >= 3 ) {
        $messages = loadArrayFromFile( $argv[3] );
 } else {
        $messages = false;