Manual talk:$wgConf

From MediaWiki.org
Jump to navigation Jump to search

Error[edit]

The url for noc.wikimedia.org/conf show a 404 error. Sir Lestaty discuţie 05:23, 6 December 2009 (UTC)

Known issue. Max Semenik 07:12, 6 December 2009 (UTC)
=D Thanks Max Sir Lestaty discuţie 08:04, 6 December 2009 (UTC)

Tutorial[edit]

The explanation on this page about how wgConf needs to be setup is very limited. Since the most common use of wgConf is with CentralAuth, I've been writing a tutorial about how to setup a wiki farm with CentralAuth and everything. I'm not sure how to setup wgConf probably myself, so please help me complete User:Huji/Wikimedia clone. Thanks! Huji (talk) 14:11, 27 August 2012 (UTC)

Variables replacement[edit]

(possibly I did something wrong...) 2 variable replacements seem to work :

  • internally defined variables like $lang, $wiki
  • variables provided through $params parameter

However it seems it's not possible to use variables (previously !) defined within the $wgConf->settings array, like :

'wgScriptPath' => //
array('default'=>'/mediawiki',
),
'wgScript' => //
array('default'=>'$wgScriptPath/index.php',
),

will leave $wgScript unreplaced. My solution was to add a postprocessing step :

$globals = $wgConf->getAll($wgConfWikiName,null,$wgConfParams,$wgConfTags);
// replace variables used in strings
foreach( $globals as $varname => $stuff ) {
	if(is_string($stuff)) {
		preg_match_all('/\$\w\w+/', $stuff, $arr);
		foreach($arr[0] as $val) {
			if(isset($val)){
				$stuff = str_replace( $val,${ substr($val,1) },$stuff );
			}
		}
		$globals[$varname]=$stuff;
	}
	//define variable so that following variables can reference it
	$GLOBALS[$varname]=$stuff;
}

(the \w\w+ hack is in order no to match the $1 variable used eg in $wgArticlePath='/$1')

--Jhf2442 (talk) 10:14, 13 September 2013 (UTC)

true has prio over false[edit]

the given example with wgGroupPermissions is poorly choosen! According to SiteConfig.php:

// Values that evaluate to true given precedence, for the primary purpose of merging permissions arrays.

This means, it's mandatory to use $wgRevokePermissions (and set the values to true) to actually disable permissions, instead of setting the fields to false in $wgGroupPermissions --Jhf2442 (talk) 21:16, 22 September 2013 (UTC)

$wikiTags[edit]

Hi folks, how can configure $wikiTags? I imagine that it is like wmf config using private, closed and other .dblist. I searched about it, but no help page or something about it is explained. Anyone can help me about it? Thanks --@lestaty discuţie 08:12, 5 May 2014 (UTC)