mediawiki/namespace-manager
Composer 安装命令:
composer require mediawiki/namespace-manager
包简介
A namespace manager for MediaWiki
关键字:
README 文档
README
NamespaceManager
This module provides a single place to manage the configuration for all namespace related variables.
Adding a setting
I recommend you add a setting by using the maintenance script dumpNSInfo.php to find the current settings that you want to have managed. This will help you determine how to set up their use in the extension.
For example, I want to put $wgCirrusSearchNamespaceWeights under management via the searchWeight key. First, I write ths bit of code inside the end of the loop in dumpNSInfo.php:
<syntaxhightlight lang="php">
if ( isset( $wgCirrusSearchNamespaceWeights ) ) {
$nsConf->$name->searchWeight = null;
if ( isset( $wgCirrusSearchNamespaceWeights[$const] ) ) {
$nsConf->$name->searchWeight
= $wgCirrusSearchNamespaceWeights[$const];
}
}
</syntaxhighlight></syntaxhightlight>
The initial if( isset(… check verifies that there is actually a variable we can adjust. This is needed because other people using the extension may not have CirrusSearch installed.
The next line sets the value for the ns to null as default. In the coorespodning load code, we will just skip the setting if the configuration for this variable is null.
The second if( isset(… checks to see if anything is set for this namespace. If there is, then the value is given to the searchWeight key.
统计信息
- 总下载量: 148
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2018-02-05