Making it work on the live servers
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 12 Jun 2004 12:56:00 +0000 (12:56 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 12 Jun 2004 12:56:00 +0000 (12:56 +0000)
maintenance/commandLine.inc

index f868b0b..102057f 100644 (file)
@@ -1,41 +1,44 @@
 <?php
+if ( strpos( "wikimedia.org", `hostname -a` ) !== false ) {
+       require_once( "liveCmdLine.inc" );
+} else {
+       if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
+               print "This script must be run from the command line\n";
+               exit();
+       }
 
-if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
-       print "This script must be run from the command line\n";
-       exit();
-}
+       $wgCommandLineMode = true;
 
-$wgCommandLineMode = true;
+       $sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
+       if ( @$argv[1] && @$argv[1] != "-" ) {
+               $lang = $argv[1];
+               putenv( "wikilang=$lang");
+               $settingsFile = "/apache/htdocs/{$argv[1]}/w/LocalSettings.php";
+               $newpath = "/apache/common/php$sep";
+       } else {
+               $settingsFile = "../LocalSettings.php";
+               $newpath = "";
+       }
 
-$sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
-if ( @$argv[1] && @$argv[1] != "-" ) {
-       $lang = $argv[1];
-       putenv( "wikilang=$lang");
-       $settingsFile = "/apache/htdocs/{$argv[1]}/w/LocalSettings.php";
-       $newpath = "/apache/common/php$sep";
-} else {
-       $settingsFile = "../LocalSettings.php";
-       $newpath = "";
-}
-
-if ( ! is_readable( $settingsFile ) ) {
-       print "A copy of your installation's LocalSettings.php\n" .
-         "must exist in the source directory.\n";
-       exit();
-}
+       if ( ! is_readable( $settingsFile ) ) {
+               print "A copy of your installation's LocalSettings.php\n" .
+                 "must exist in the source directory.\n";
+               exit();
+       }
 
 
-$wgCommandLineMode = true;
-$DP = "../includes";
-include_once( $settingsFile );
-ini_set( "include_path", "../includes$sep../languages$sep$newpath$IP$sep$include_path" );
+       $wgCommandLineMode = true;
+       $DP = "../includes";
+       include_once( $settingsFile );
+       ini_set( "include_path", "../includes$sep../languages$sep$newpath$IP$sep$include_path" );
 
-$wgUsePHPTal = false;
-define("MEDIAWIKI",true);
-include_once( "Setup.php" );
-include_once( "./InitialiseMessages.inc" );
-include_once( "../install-utils.inc" );
-$wgTitle = Title::newFromText( "Rebuild messages script" );
-$wgCommandLineMode = true;
-set_time_limit(0);
+       $wgUsePHPTal = false;
+       define("MEDIAWIKI",true);
+       include_once( "Setup.php" );
+       include_once( "./InitialiseMessages.inc" );
+       include_once( "../install-utils.inc" );
+       $wgTitle = Title::newFromText( "Rebuild messages script" );
+       $wgCommandLineMode = true;
+       set_time_limit(0);
+}
 ?>