Manual:getConfiguration.php
From Linux Web Expert
<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.23
<translate> MediaWiki version:</translate> |
MediaWiki file: getConfiguration.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.41.1 • 1.40.3 • 1.39.7 |
Classes: | GetConfiguration |
Details
getConfiguration.php file is a maintenance script to print serialized output of MediaWiki config variables.
Options
Option | Description | Required | Default |
---|---|---|---|
--regex | Regex to filter variables with | <translate> Optional</translate> | |
--iregex | Same as --regex but case insensitive | <translate> Optional</translate> | |
--settings | Space-separated list of wg* variables | <translate> Optional</translate> | |
--format | Output format, either json, php, serialize, or vardump | <translate> Optional</translate> | php |
Usage
php maintenance/getConfiguration.php [ --regex| --iregex| --settings| --format ]
With settings
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
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