MediaWiki REL1_30
commandLine.inc
Go to the documentation of this file.
1<?php
24require_once __DIR__ . '/Maintenance.php';
25
26// @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
29// @codingStandardsIgnoreEnd
30if ( !isset( $optionsWithArgs ) ) {
32}
33if ( !isset( $optionsWithoutArgs ) ) {
35}
36
38 public function __construct() {
39 // @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
41 // @codingStandardsIgnoreEnd
42 parent::__construct();
43 foreach ( $optionsWithArgs as $name ) {
44 $this->addOption( $name, '', false, true );
45 }
46 foreach ( $optionsWithoutArgs as $name ) {
47 $this->addOption( $name, '', false, false );
48 }
49 }
50
55 protected function maybeHelp( $force = false ) {
56 if ( !$force ) {
57 return;
58 }
59 parent::maybeHelp( true );
60 }
61
62 public function execute() {
63 // @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
64 global $args, $options;
65 // @codingStandardsIgnoreEnd
68 }
69}
70
71$maintClass = 'CommandLineInc';
if( $line===false) $args
Definition cdb.php:63
execute()
Do the actual work.
maybeHelp( $force=false)
No help, it would just be misleading since it misses custom options.
__construct()
Default constructor.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
addOption( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false)
Add a parameter to the script.
global $optionsWithArgs
$maintClass
global $optionsWithoutArgs
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
Definition hooks.txt:1971
require_once RUN_MAINTENANCE_IF_MAIN