On Tue, Aug 19, 2008 at 4:15 AM, Victor Vasiliev <vasilvv(a)gmail.com> wrote:
* Note that extractGlobal() is not used on Wikimedia.
I'll move that code into get over the next few days.
* extractGlobal() supposes that configuration variable
has a "+" prefix,
while get() supposes that target wiki should have it.
They're *different* ideas. One is for settings for different tags to
be cumulative, i.e. the setting for enwiki will add to, not override
the setting for default. The other is for settings in $wgConf to be
cumulative with settings set outright, i.e. the settings in wgConf
will add to, not override the original global.
* Mergability should be property of a configuration
variable (so we use
"+wgGroupPermissions" instead of "wgGroupPermissions" => array(
"+enwiki" => ... ).
See above. They're *different* ideas.
* It doesn't seem to merge arrays recursively.
That means that in
"wgGroupPermissions" => array(
'default' => array( 'user' => array( 'something' =>
true ) ),
'enwiki' => array( 'user' => array( 'somthingelse'
=> true ) ),
) enwiki settings will override defaults, therefore you should use
array_merge_recursive().
Good point, fixed in r39623.
* If we want it to be usable for other parts of the
code which are ran
when $wgConf is already extracted, we need to know default settings. To
determine default settings it's possible to include DefaultSettings.php
in the local scope and get a value of the configuration variable, but it
does not work with group permissions since they are modified by
extensions + CommonSettings.php also modifies them.
DefaultSettings.php is already included by the time we extract wgConf.
Extensions tend to arrays in-place, instead of replacing it by
something new, i.e. $wgGroupPermissions['sysop']['move'] = true,
rather than $wgGroupPermissions = array( 'sysop' => array( 'move'
=>
true ) );
--
Andrew Garrett