Erps, fix timestamp formatting
[mediawiki.git] / maintenance / liveCmdLine.inc
blobf50dce688c0e8f706f404ac31441da2178eacf84
1 <?php
2 /**
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
7  *
8  * @todo document
9  * @package MediaWiki
10  * @subpackage Maintenance
11  */
13 /** */
14 if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
15         print "This script must be run from the command line\n";
16         exit();
19 $wgCommandLineMode = true;
20 $self = array_shift( $argv );
21 # Turn off output buffering if it's on
22 @ob_end_flush();
24 if ( isset( $argv[0] ) ) {
25         $lang = array_shift( $argv );
26 } else {
27         $lang = "aa";
29 if ( isset( $argv[0] ) ) {
30         $site = array_shift( $argv );
31 } else {
32         $site = "wikipedia";
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 = PATH_SEPARATOR;
42 putenv( "wikilang=$lang");
43 $newpath = "/home/wikipedia/common/php-new$sep";
45 $DP = "../includes";
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;
56 set_time_limit(0);