mediawiki / namespace-manager
A namespace manager for MediaWiki
Installs: 140
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 0
Open Issues: 0
Type:mediawiki-extension
Requires
- php: >=5.5.0
- composer/installers: 1.*,>=1.0.1
Requires (Dev)
- jakub-onderka/php-console-highlighter: 0.3.2
- jakub-onderka/php-parallel-lint: 0.9.2
- mediawiki/mediawiki-codesniffer: ~26.0
- mediawiki/minus-x: 0.2.1
- phpmd/phpmd: ~2.1
This package is auto-updated.
Last update: 2024-12-18 00:56:07 UTC
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.