26require_once __DIR__ .
'/Maintenance.php';
51 parent::__construct();
52 $this->
addDescription(
'Get serialized MediaWiki site configuration' );
53 $this->
addOption(
'regex',
'regex to filter variables with',
false,
true );
54 $this->
addOption(
'iregex',
'same as --regex but case insensitive',
false,
true );
55 $this->
addOption(
'settings',
'Space-separated list of wg* variables',
false,
true );
56 $this->
addOption(
'format', implode(
', ', self::$outFormats ),
false,
true );
62 # Get the format and make sure it is set to a valid default value
65 $validFormat =
in_array( $format, self::$outFormats );
66 if ( !$validFormat ) {
67 $this->
error(
"--format set to an unrecognized format" );
72 $this->
error(
"Can only use either --regex or --iregex" );
76 parent::validateParamsAndArgs();
92 $this->regex =
'/' . $this->regex .
'/';
94 $this->regex .=
'i'; #
case insensitive regex
99 $this->settings_list = explode(
' ', $this->
getOption(
'settings' ) );
101 foreach ( $this->settings_list as $name ) {
103 throw new MWException(
"Variable '$name' does start with 'wg'." );
105 throw new MWException(
"Variable '$name' is not set." );
107 throw new MWException(
"Variable '$name' includes non-array, non-scalar, items." );
117 # Sane default: dump any wg / wmg variable
118 if ( !$this->regex && !$this->
getOption(
'settings' ) ) {
119 $this->regex =
'/^wm?g/';
122 # Filter out globals based on the regex
123 if ( $this->regex ) {
132 # Explicitly dumps a list of provided global names
133 if ( $this->settings_list ) {
134 foreach ( $this->settings_list as $name ) {
154 throw new MWException(
"Invalid serialization format given." );
157 throw new MWException(
"Failed to serialize the requested settings." );
171 # grab var_dump() output and discard it from the output buffer
180 foreach (
$value as $k => $v ) {
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Print serialized output of MediaWiki config vars.
isAllowedVariable( $value)
execute()
Do the actual work.
static $outFormats
List of format output internally supported.
finalSetup()
finalSetup() since we need MWException
__construct()
Default constructor.
validateParamsAndArgs()
Run some validation checks on the params, etc.
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
output( $out, $channel=null)
Throw some output to the user.
hasOption( $name)
Checks to see if a particular option exists.
addDescription( $text)
Set the description text.
maybeHelp( $force=false)
Maybe show the help.
addOption( $name, $description, $required=false, $withArg=false, $shortName=false, $multiOccurrence=false)
Add a parameter to the script.
getOption( $name, $default=null)
Get an option, or return the default.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults error
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 noclasses & $ret
Allows to change the fields on the form that will be generated $name
while(( $__line=Maintenance::readconsole()) !==false) print
require_once RUN_MAINTENANCE_IF_MAIN