3 * This is a drop-in replacement for commandLine.inc, for use only on
5 * Call your command-line script with the language name and site name,
6 * e.g. php convertLinks.php aa wikipedia
10 * @subpackage Maintenance
14 if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
15 print "This script must be run from the command line\n";
19 $wgCommandLineMode = true;
20 $self = array_shift( $argv );
21 # Turn off output buffering if it's on
24 if ( isset( $argv[0] ) ) {
25 $lang = array_shift( $argv );
29 if ( isset( $argv[0] ) ) {
30 $site = array_shift( $argv );
35 # This is for the IRC scripts, which now run as the apache user
36 if ( $_ENV['USER'] != "apache" ) {
37 $wgDBadminuser = "wikiadmin";
38 $wgDBadminpassword = trim(`wikiadmin_pass`);
41 $sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
42 putenv( "wikilang=$lang");
43 $newpath = "/home/wikipedia/common/php-new$sep";
46 #ini_set( "include_path", "$newpath$sep$include_path" );
47 ini_set( "include_path", "/home/wikipedia/common/php-new:/home/wikipedia/common/php-new/includes" );
49 require_once( "/home/wikipedia/common/php-new/CommonSettings.php" );
51 define("MEDIAWIKI",true);
52 require_once( "Setup.php" );
53 require_once( "../install-utils.inc" );
54 $wgTitle = Title::newFromText( "Command line script" );
55 $wgCommandLineMode = true;