Manual:Maintenance.php/zh

From MediaWiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:Maintenance.php and the translation is 32% complete.

Other languages:
English • ‎dansk • ‎español • ‎polski • ‎português do Brasil • ‎русский • ‎中文 • ‎日本語

The Maintenance class is the abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effort.

Functions

addDescription()

  • addDescription( $text);
    • $text: set the description text.

addArg()

  • addArg( $arg, $description, $required = true );
    • $arg: name of the arg
    • $description: short description of the arg
    • $required: 需要它吗?

addOption()

  • addOption($name, $description, $required=false, $withArg=false, $shortName=false);
    • $required: 这是必需的参数吗?
    • $withArg: is an argument required with this option?
    • $shortName: 用作短名称的字符

The shortname would be, e.g., 'm' if you wanted -mFast to be an alternative to --mode=Fast.

getArg()

  • getArg( $argId = 0, $default = null );
    • $argId: the integer value (from zero) for the arg
    • $default: 如果它不存在则为默认值

getOption()

  • getOption( $name, $default = null );
    • $name: 参数的名称
    • $default: 默认

outPut()

  • output( $output, $channel = null );

runChild()

  • runChild( $maintClass, $classFile = null );
    • maintClass: a name of a child maintenance class
    • $classFile: full path of where the child is

See also