Phpdoc comments
[lhc/web/wiklou.git] / maintenance / liveCmdLine.inc
index 5d51a6a..a3a28ca 100644 (file)
@@ -1,24 +1,33 @@
 <?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
-
+/**
+ * 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
+ *
+ * @todo document
+ * @package MediaWiki
+ * @subpackage Maintenance
+ */
+
+/** */
 if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
        print "This script must be run from the command line\n";
        exit();
 }
 
 $wgCommandLineMode = true;
+$self = array_shift( $argv );
+# Turn off output buffering if it's on
+@ob_end_flush();
 
-if ( isset( $argv[1] ) ) {
-       $lang = $argv[1];
+if ( isset( $argv[0] ) ) {
+       $lang = array_shift( $argv );
 } else {
        $lang = "aa";
 }
-if ( isset( $argv[2] ) ) {
-       $site = $argv[2];
+if ( isset( $argv[0] ) ) {
+       $site = array_shift( $argv );
 } else {
        $site = "wikipedia";
 }
@@ -42,7 +51,8 @@ require_once( "/home/wikipedia/common/php-new/CommonSettings.php" );
 $wgUsePHPTal = false;
 
 define("MEDIAWIKI",true);
-include_once( "Setup.php" );
+require_once( "Setup.php" );
+require_once( "../install-utils.inc" );
 $wgTitle = Title::newFromText( "Command line script" );
 $wgCommandLineMode = true;
 set_time_limit(0);