Braces and spaces
[lhc/web/wiklou.git] / maintenance / commandLine.inc
index e241d5e..0720e76 100644 (file)
@@ -3,8 +3,11 @@
 /**
  * Backwards-compatibility wrapper for old-style maintenance scripts
  */
-require( dirname(__FILE__) . '/Maintenance.php' );
-$optionsWithArgs = array();
+require( dirname( __FILE__ ) . '/Maintenance.php' );
+
+if ( !isset( $optionsWithArgs ) ) {
+    $optionsWithArgs = array();
+}
 
 class CommandLineInc extends Maintenance {
        public function __construct() {
@@ -13,9 +16,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() {