This fixes bug 984629, but gives a double footer
[mediawiki.git] / maintenance / liveCmdLine.inc
blob67d09d19c275cf4b06dcdb338c989f518c1077c2
1 <?php
3 # This is a drop-in replacement for commandLine.inc, for use only on
4 # the Wikimedia wikis.
5 # Call your command-line script with the language name and site name,
6 # e.g. php convertLinks.php aa wikipedia
8 if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
9         print "This script must be run from the command line\n";
10         exit();
13 $wgCommandLineMode = true;
14 $self = array_shift( $argv );
15 # Turn off output buffering if it's on
16 @ob_end_flush();
18 if ( isset( $argv[0] ) ) {
19         $lang = array_shift( $argv );
20 } else {
21         $lang = "aa";
23 if ( isset( $argv[0] ) ) {
24         $site = array_shift( $argv );
25 } else {
26         $site = "wikipedia";
29 # This is for the IRC scripts, which now run as the apache user
30 if ( $_ENV['USER'] != "apache" ) {
31         $wgDBadminuser = "wikiadmin";
32         $wgDBadminpassword = trim(`wikiadmin_pass`);
35 $sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
36 putenv( "wikilang=$lang");
37 $newpath = "/home/wikipedia/common/php-new$sep";
39 $DP = "../includes";
40 #ini_set( "include_path", "$newpath$sep$include_path" );
41 ini_set( "include_path", "/home/wikipedia/common/php-new:/home/wikipedia/common/php-new/includes" );
43 require_once( "/home/wikipedia/common/php-new/CommonSettings.php" );
45 $wgUsePHPTal = false;
47 define("MEDIAWIKI",true);
48 require_once( "Setup.php" );
49 require_once( "../install-utils.inc" );
50 $wgTitle = Title::newFromText( "Command line script" );
51 $wgCommandLineMode = true;
52 set_time_limit(0);