Command line header for the Wikimedia wikis. Doesn't contain any sensitive informatio...
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 2 Jun 2004 02:15:35 +0000 (02:15 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 2 Jun 2004 02:15:35 +0000 (02:15 +0000)
maintenance/liveCmdLine.inc [new file with mode: 0644]

diff --git a/maintenance/liveCmdLine.inc b/maintenance/liveCmdLine.inc
new file mode 100644 (file)
index 0000000..5d51a6a
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+
+# This is a drop-in replacement for commandLine.inc, for use only on
+# the Wikimedia wikis.
+# Call your command-line script with the language name and site name,
+# e.g. php convertLinks.php aa wikipedia
+
+if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
+       print "This script must be run from the command line\n";
+       exit();
+}
+
+$wgCommandLineMode = true;
+
+if ( isset( $argv[1] ) ) {
+       $lang = $argv[1];
+} else {
+       $lang = "aa";
+}
+if ( isset( $argv[2] ) ) {
+       $site = $argv[2];
+} else {
+       $site = "wikipedia";
+}
+
+# This is for the IRC scripts, which now run as the apache user
+if ( $_ENV['USER'] != "apache" ) {
+       $wgDBadminuser = "wikiadmin";
+       $wgDBadminpassword = trim(`wikiadmin_pass`);
+}
+
+$sep = strchr( $include_path = ini_get( "include_path" ), ";" ) ? ";" : ":";
+putenv( "wikilang=$lang");
+$newpath = "/home/wikipedia/common/php-new$sep";
+
+$DP = "../includes";
+#ini_set( "include_path", "$newpath$sep$include_path" );
+ini_set( "include_path", "/home/wikipedia/common/php-new:/home/wikipedia/common/php-new/includes" );
+
+require_once( "/home/wikipedia/common/php-new/CommonSettings.php" );
+
+$wgUsePHPTal = false;
+
+define("MEDIAWIKI",true);
+include_once( "Setup.php" );
+$wgTitle = Title::newFromText( "Command line script" );
+$wgCommandLineMode = true;
+set_time_limit(0);
+?>