Retrieve values configuration settings MediaWiki

你。 提交于 2019-12-12 02:55:33

问题


How can I retrieve the values of (all) MediaWiki configuration settings and show them in a wikipage for testing? A bit like phpinfo.


回答1:


Manual:GetConfiguration.php:

echo `php maintenance/getConfiguration.php --format vardump`;

Options:

Script specific parameters:
    --format: json, php, serialize, vardump
    --iregex: same as --regex but case insensitive
    --regex: regex to filter variables with
    --settings: Space-separated list of wg* variables



回答2:


You could use a method from this question to fetch all variables from DefaultSettings.php, and then loop through them to print out their results.

Maybe something like this:

global $IP;
$defaultSettingsFile = file_get_contents($IP . 'DeafultSettings.php'); 
preg_match_all('/\$[A-Za-z0-9-_]+/', $defaultSettingsFile, $param);
foreach( $param as $p ){
  echo "$p:  ${$p}\n";
}


来源:https://stackoverflow.com/questions/27815179/retrieve-values-configuration-settings-mediawiki

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!