2 if ( strpos( `hostname -a`, "wikimedia.org" ) !== false ) {
3 require_once( "liveCmdLine.inc" );
5 # Turn off output buffering if it's on
8 if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
9 print "This script must be run from the command line\n";
13 $wgCommandLineMode = true;
15 $sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
16 if ( @$argv[1] && @$argv[1] != "-" ) {
17 $self = array_shift( $argv );
18 $lang = array_shift( $argv );
19 putenv( "wikilang=$lang");
20 $settingsFile = "/apache/htdocs/{$argv[1]}/w/LocalSettings.php";
21 $newpath = "/apache/common/php$sep";
23 $settingsFile = "../LocalSettings.php";
27 if ( ! is_readable( $settingsFile ) ) {
28 print "A copy of your installation's LocalSettings.php\n" .
29 "must exist in the source directory.\n";
34 $wgCommandLineMode = true;
36 include_once( $settingsFile );
37 ini_set( "include_path", "../includes$sep../languages$sep$newpath$IP$sep$include_path" );
40 define("MEDIAWIKI",true);
41 include_once( "Setup.php" );
42 include_once( "../install-utils.inc" );
43 $wgTitle = Title::newFromText( "Command line script" );
44 $wgCommandLineMode = true;