Add MW_CONFIG_FILE support to load a separate config file instead of LocalSettings...
[lhc/web/wiklou.git] / maintenance / commandLine.inc
index 6ed7b2e..fd13bdc 100644 (file)
@@ -3,10 +3,11 @@
 /**
  * Backwards-compatibility wrapper for old-style maintenance scripts
  */
-require( dirname(__FILE__) . '/Maintenance.php' );
+require( dirname( __FILE__ ) . '/Maintenance.php' );
 
+global $optionsWithArgs;
 if ( !isset( $optionsWithArgs ) ) {
-    $optionsWithArgs = array();
+       $optionsWithArgs = array();
 }
 
 class CommandLineInc extends Maintenance {
@@ -16,9 +17,22 @@ class CommandLineInc extends Maintenance {
                foreach ( $optionsWithArgs as $name ) {
                        $this->addOption( $name, '', false, true );
                }
+       }
+
+       public function getDbType() {
+               global $wgUseNormalUser;
+
+               return ( isset( $wgUseNormalUser ) && $wgUseNormalUser ) ?
+                       Maintenance::DB_STD : Maintenance::DB_ADMIN;
+       }
 
-               # No help, it would just be misleading since it misses custom options
-               unset( $this->mParams['help'] );
+       /**
+        * No help, it would just be misleading since it misses custom options
+        */
+       protected function maybeHelp( $force = false ) {
+               if ( !$force )
+                       return;
+               parent::maybeHelp( true );
        }
 
        public function execute() {