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
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 if ( isset( $argv[1] ) ) {
20 if ( isset( $argv[2] ) ) {
26 # This is for the IRC scripts, which now run as the apache user
27 if ( $_ENV['USER'] != "apache" ) {
28 $wgDBadminuser = "wikiadmin";
29 $wgDBadminpassword = trim(`wikiadmin_pass`);
32 $sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
33 putenv( "wikilang=$lang");
34 $newpath = "/home/wikipedia/common/php-new$sep";
37 #ini_set( "include_path", "$newpath$sep$include_path" );
38 ini_set( "include_path", "/home/wikipedia/common/php-new:/home/wikipedia/common/php-new/includes" );
40 require_once( "/home/wikipedia/common/php-new/CommonSettings.php" );
44 define("MEDIAWIKI",true);
45 include_once( "Setup.php" );
46 $wgTitle = Title::newFromText( "Command line script" );
47 $wgCommandLineMode = true;