Manual:Hooks/MaintenanceUpdateAddParams

From Linux Web Expert

MaintenanceUpdateAddParams
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 498296)</tvar></translate>
allow extensions to add params to the update.php maintenance script.
<translate> Define function:</translate>
public static function onMaintenanceUpdateAddParams( array &$params ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"MaintenanceUpdateAddParams": "MediaWiki\\Extension\\MyExtension\\Hooks::onMaintenanceUpdateAddParams"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> ../maintenance/update.php
<translate> Function(s):</translate> validateParamsAndArgs
<translate> Interface:</translate> MaintenanceUpdateAddParamsHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:MaintenanceUpdateAddParams extensions</tvar>.</translate>


Details

  • &$params: array to populate with the params to be added. Array elements are keyed by the param name. Each param is an associative array that must include the following keys:
    • 'desc': The description of the param to show on --help
    • 'require': Is the param required? Defaults to false if not set.
    • 'withArg': Is an argument required with this option? Defaults to false if not set.
    • 'shortName': Character to use as short name, or false if none. Defaults to false if not set.
    • 'multiOccurrence': Can this option be passed multiple times? Defaults to false if not set.