]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - maintenance/commandLine.inc
MediaWiki 1.16.0
[autoinstallsdev/mediawiki.git] / maintenance / commandLine.inc
1 <?php
2
3 /**
4  * Backwards-compatibility wrapper for old-style maintenance scripts
5  */
6 require( dirname(__FILE__) . '/Maintenance.php' );
7
8 if ( !isset( $optionsWithArgs ) ) {
9     $optionsWithArgs = array();
10 }
11
12 class CommandLineInc extends Maintenance {
13         public function __construct() {
14                 global $optionsWithArgs;
15                 parent::__construct();
16                 foreach ( $optionsWithArgs as $name ) {
17                         $this->addOption( $name, '', false, true );
18                 }
19         }
20
21         public function getDbType() {
22                 global $wgUseNormalUser;
23
24                 return ( isset( $wgUseNormalUser ) && $wgUseNormalUser ) ?
25                         Maintenance::DB_STD : Maintenance::DB_ADMIN;
26         }
27
28         /**
29          * No help, it would just be misleading since it misses custom options
30          */
31         protected function maybeHelp( $force = false ) {
32                 if ( !$force )
33                         return;
34                 parent::maybeHelp( true );
35         }
36
37         public function execute() {
38                 global $args, $options;
39                 $args = $this->mArgs;
40                 $options = $this->mOptions;
41         }
42 }
43
44 $maintClass = 'CommandLineInc';
45 require( DO_MAINTENANCE );
46