Manual:getConfiguration.php
Appearance
MediaWiki version: | ≥ 1.23 |
MediaWiki file: getConfiguration.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.42.3 • 1.41.4 • 1.39.10 |
Classes: | GetConfiguration |
Details
[edit]getConfiguration.php file is a maintenance script to print serialized output of MediaWiki config variables.
Options
[edit]Option | Description | Required | Default |
---|---|---|---|
--regex | Regex to filter variables with | Optional | |
--iregex | Same as --regex but case insensitive | Optional | |
--settings | Space-separated list of wg* variables | Optional | |
--format | Output format, either json, php, serialize, or vardump | Optional | php |
Usage
[edit]php maintenance/getConfiguration.php [ --regex| --iregex| --settings| --format ]
With settings
[edit]Terminal
$ php maintenance/getConfiguration.php --format vardump --settings wgSessionProviders $wgSessionProviders = array(2) { ["MediaWiki\Session\CookieSessionProvider"]=> array(2) { ["class"]=> string(39) "MediaWiki\Session\CookieSessionProvider" ["args"]=> array(1) { [0]=> array(2) { ["priority"]=> int(30) ["callUserSetCookiesHook"]=> bool(true) } } } ["MediaWiki\Session\BotPasswordSessionProvider"]=> array(2) { ["class"]=> string(44) "MediaWiki\Session\BotPasswordSessionProvider" ["args"]=> array(1) { [0]=> array(1) { ["priority"]=> int(75) } } } };
With regex
[edit]Terminal
$ php maintenance/getConfiguration.php --format json --regex "wgUse(.+)" { "wgUseAutomaticEditSummaries":true, "wgUseCategoryBrowser":false, "wgUseCdn":false, "wgUseCombinedLoginLink":false, "wgUseContentMediaStyles":false, "wgUseCopyrightUpload":false, "wgUseDatabaseMessages":true, "wgUseEnotif":true, "wgUseFileCache":false, "wgUseFilePatrol":true, "wgUseGzip":false, "wgUseImageMagick":false, "wgUseImageResize":true, "wgUseInstantCommons":true, "wgUseLocalMessageCache":false, "wgUseMediaWikiUIEverywhere":false, "wgUseNPPatrol":true, "wgUsePathInfo":true, "wgUsePigLatinVariant":false, "wgUsePrivateIPs":false, "wgUseRCPatrol":true, "wgUseSameSiteLegacyCookies":false, "wgUseSharedUploads":false, "wgUseSiteCss":true, "wgUseSiteJs":true, "wgUseTagFilter":true, "wgUseTinyRGBForJPGThumbnails":false, "wgUser":{ "realUser":{ "mId":null, "mName":null, "mActorId":null, "mRealName":null, "mEmail":null, "mTouched":null, "mEmailAuthenticated":null, "mFrom":"session", "mBlockedby":-1, "mHideName":null, "mBlock":null } }, "wgUserEmailConfirmationTokenExpiry":604800, "wgUserEmailUseReplyTo":true, "wgUserrightsInterwikiDelimiter":"@", "wgUsersNotifiedOnAllChanges":[ ] }
Use JSON_PARTIAL_OUTPUT_ON_ERROR (--json-partial-output-on-error) flag with json_encode(). This allows for partial response to be output in case of an exception while serializing to JSON. If an error occurs, the
wgGetConfigurationJsonErrorOccurred
field is set in the output.Terminal
$ php maintenance/getConfiguration.php --format json --json-partial-output-on-error